Magento 2.4.2 Free Shipping for some items by sku or category

Magento 2.4.2
Cart Price Rules

Free Shipping on only select few items not working when non free ship sku is added to cart.

Rule Name: name
Active: true
Coupon: No
Customer Groups: ALL
Websites: All

Conditions: Blank All items

Actions:
Apply: Percent of product price discount
Discount Amount: 0
Max Qty: 0
Discount Qty Step: 1
Apply to Shipping Amount: Yes
Discard Subsequent rules: No

Apply the Rule only to cart items matching the following conditions:
I have
SKU is one of SKU1,SKU2,SKU3

Free Shipping: For shipment with matching items
enter image description here

Configuration -> Sales -> Delivery Methods
FREE SHIPPING

**Enabled :**No
If I enable this it always show free shipping. I do not want this option. I have seen many post saying enable this.
enter image description here

I use USPS shipping module that is built in with Magento 2.4.2
Free Method: Priority Mail (which is enabled in allowed methods)
Enable Free Shipping Threshold: Disable
enter image description here

STEPS

  1. I add SKU4 to cart
  2. Put in a location US CO 80014
  3. USPS priority mail show $12.60 (Works Great)
  4. Add SKU1 (frees ship Sku) to cart which and adds onto the shipping cost. $0.60 from $12.60 to $13.20
  5. Remove SKU4 the shipping price Drops back to free.

**WHAT is suppose to happen: **
When SKU4 is in cart alone charge shipping. This works $12.60 for SKU4
When SKU1 is added to cart with SKU4 shipping should still be the same. $12.60 but it changes to $13.20
When SKU1 is in cart $0.00 Shipping. This works

SKU4 Not in RULE so this picture is correct charge shipping.
enter image description here

SKU4 and added SKU1: SKU1 is free ship so it should still be the shipping for SKU4 only not SKU1’s add-on cost.
enter image description here

Remove SKU4 and Free Shipping works
With SKU4 removed SKU1 now is free shipping.
enter image description here

category theory – Image of a morphism of sheaves of vector spaces is a sheaf: what are the restriction maps?

Let $f : mathcal{F} to mathcal{G}$ be a morphism of sheaves of (complex) vector spaces on a space $X$, so $f$ is a collection of $f_U$ defined on open $U subset X$.
The image of $f$ is defined in my lectures as as $$mathcal{I}(U) := {a in mathcal{G}(U) : text{ there exists an open cover } U_i text{ of } U text{ s.t. } avert_{U_i} in f(mathcal{F}(U_i))}.$$
I want to show that this is a sheaf, but I am struggling to work with the definition, even with defining what the restriction maps $rho_{U,V}$ should do.
I have seen the fact that the category of sheaves of $mathbb{C}$-vector spaces is abelian, and in Vakil’s notes he says that

We needn’t worry about restriction maps – they “come along for the ride”.

But when making things concrete, it is hard for me to resolve.
What am I misunderstanding here? I am fairly new to category theory and sheaves, so I would prefer something that uses as little of extra abstract machinery as possible.

Adding custom post category slug in permalink causes 404 error for pages and posts

I have added a custom post type, I want to add the custom post category in its permalink instead of the static base.

For example for the custom posts I want the following permalink structure:

mysite.com/category1/custom-post1
mysite.com/category3/custom-post2
mysite.com/category4/custom-post3

In the above examples category1, category2 and category3 are the categories of custom post type.

Notice that there is no custom post base slug in the URL.

I am using the following code for it, it works for the custom posts and gets the permalinks correctly, however it gives 404 error for the default posts and pages. How can I fix that so that default posts and pages also work?

Default page/post permalink would be like:

mysite.com/sample-page
mysite.com/2021/04/hello-world/

Here’s the code that I’m using:

register_post_type( 'business', array( 
    'labels'                 => array(
        'name'               => __( 'Businesses' ),
        'singular_name'      => __( 'Business' ),
        'add_new'            => __( 'Add New' ),
        'add_new_item'       => __( 'Create New Business' ),
        'edit'               => __( 'Edit' ),
        'edit_item'          => __( 'Edit Business' ),
        'new_item'           => __( 'New Business' ),
        'view'               => __( 'View Businesses' ),
        'view_item'          => __( 'View Business' ),
        'search_items'       => __( 'Search Businesses' ),
        'not_found'          => __( 'No businesses found' ),
        'not_found_in_trash' => __( 'No businesses found in trash' ),
        'parent'             => __( 'Parent Business' ),
    ),
    'description'           => __( 'This is where you can create new businesses on your site.' ),
    'public'                => true,
    'show_ui'               => true,
    'capability_type'       => 'post',
    'publicly_queryable'    => true,
    'exclude_from_search'   => false,
    'has_archive'           => true,
    'menu_position'         => 2,
    'menu_icon'             => 'dashicons-id',
    'hierarchical'          => true,
    '_builtin'              => false,
    'rewrite'               => array( 'slug' => '%business_cat%', 'with_front' => false ),
    'query_var'             => true,
    'supports'              => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions' ),
) );


add_action( 'init', 'create_product_taxonomies', 0 );

function create_product_taxonomies() {
    $labels = array(
        'name'              => _x( 'Categories', 'taxonomy general name' ),
        'singular_name'     => _x( 'Category', 'taxonomy singular name' ),
        'search_items'      =>  __( 'Search Categories' ),
        'all_items'         => __( 'All Categories' ),
        'parent_item'       => __( 'Parent Categories' ),
        'parent_item_colon' => __( 'Parent Categories:' ),
        'edit_item'         => __( 'Edit Category' ), 
        'update_item'       => __( 'Update Category' ),
        'add_new_item'      => __( 'Add New Category' ),
        'new_item_name'     => __( 'New Category Name' ),
        'menu_name'         => __( 'Category' ),
    );  

    register_taxonomy( 'business_cat', array( 'business' ), array(
        'hierarchical'  => true,
        'labels'        => $labels,
        'show_ui'       => true,
        'query_var'     => true,
        'rewrite'       => array( 'slug' => '%business_cat%', 'with_front' => false ),
    ) );
}

function wpse_5308_post_type_link( $link, $post ) {
    if ( $post->post_type === 'business' ) {
        if ( $terms = get_the_terms( $post->ID, 'business_cat' ) )
            $link = str_replace( '%business_cat%', current( $terms )->slug, $link );
        else
            $link = str_replace( '%business_cat%', 'uncategorized', $link );
    }

    return $link;
}

add_filter( 'post_type_link', 'wpse_5308_post_type_link', 10, 2 );

magento2 – Product are not displaying on Category page after Data Migration

For this you need to change into database set only is_filterable_in_search to 0

This is old code

SELECT *
FROM catalog_eav_attribute cea
JOIN eav_attribute ea
ON ea.attribute_id = cea.attribute_id 
AND backend_type IN ('text')
WHERE 
cea.is_filterable = 1 OR cea.is_filterable_in_search = 1

Replace with below one code with your prefix like.

UPDATE **prefix_**catalog_eav_attribute cea 
JOIN **prefix_**eav_attribute ea
ON ea.attribute_id = cea.attribute_id
AND backend_type in ('text')
SET 
cea.is_filterable = 0, cea.is_filterable_in_search = 0
WHERE 
cea.is_filterable = 1 OR cea.is_filterable_in_search = 1

Now after that just do reindex and cache

magento indexer:reindex
magento cache:clean
magento cache:flush

That’s it..

php – show category list with images of associated posts

any way to display a list of categories with a single image of any post associated with that category?

i have this code:

    $categories = get_categories( array(
        'orderby' => 'name',
        'order'   => 'ASC'
    ) );
     
    foreach( $categories as $category ) {
        $category_link = sprintf( 
            '<a href="%1$s" alt="%2$s">%3$s</a>',
            esc_url( get_category_link( $category->term_id ) ),
            esc_attr( sprintf( __( 'View all posts in %s', 'textdomain' ), $category->name ) ),
            esc_html( $category->name )
        );
         
        echo '<p>' . sprintf( esc_html__( 'Category: %s', 'textdomain' ), $category_link ) . '</p> ';
        echo '<p>' . sprintf( esc_html__( 'Description: %s', 'textdomain' ), $category->description ) . '</p>';
        echo '<p>' . sprintf( esc_html__( 'Post Count: %s', 'textdomain' ), $category->count ) . '</p>';
 echo '<p>' . sprintf( esc_html__( 'image: %s', '......' ), $image->... ) . '</p>';
    } 

category theory – Defining equivalences between equivalences of groupoids

Given two groupoids $A$ and $B$, if $F, G: A to B$ are both equivalences of groupoids equipped with a choice of inverses $F^{-1}$, $G^{-1}$ and appropriate natural isomorphisms.

Then I would expect that an equivalence between $F$ and $G$ will be a natural isomorphism $eta: F to G$. Suppose this is given.

My question is:

Does this imply that there exists a natural isomorphism $mu: F^{-1} to G^{-1}$ that can be constructed from the starting data?