Quantity discount for same category

I would like to have a sale where if you buy 3 items from category ‘widgets’ you get 25% off.

I setup the following rule. It works fine if you add 3+ products from category ‘widgets(118)’, however it also activates if there is 2 items from category ‘widgets(118)’ and 1 item from category ‘flyers(120)’. It doesn’t apply the discount to the item from category ‘flyers(120)’, only the 2 products from ‘category’ widgets however it is counting the quantity as 3 even though there is only 2 products from category ‘widget’. Not sure what I am doing wrong here,

Conditions Apply the rule only if the following conditions are met (leave blank for all products).  If ALL  of these conditions are TRUE :  If total quantity  equals or greater than  3  for a subselection of items in cart matching ALL  of these conditions:     Category  is  118    Percent of produce price discount 25  Apply the rule only to cart items matching the following conditions (leave blank for all items).  If ALL  of these conditions are TRUE :  Category  is  118  

Load category, but only with limited data to build a Breadcrumb

Based on the helper catalog there is a function that returns a path for the breadcrumb to be displayed in Magento when viewing a Product.

I want to enhance this method to return the full path of the categories back to me.

Current implementation:

  ...           if ($  this->getProduct()) {                 $  path['product'] = array('label'=>$  this->getProduct()->getName());             }         $  this->_categoryPath = $  path; 

Here I want to append a process that load the categories of the product via getCategoryIds(), which is available trough the getProduct() method.

I’d like to load a conditional collection, that only loads the respective ID of the categories but only the following data:

  • url
  • name
  • title
  • my_custom_eav_param

I assume something like:

        if ($  product = $  this->getProduct()) {             $  cats = $  product->getCategoryIds();             foreach ($  cats as $  category_id) {                 $  attributesToSelect = [''];                 $  _cat = Mage::getModel('catalog/category')                     ->getCollection()                     ->addAttributeToSelect('*')                     ->addAttributeToFilter(['name', 'id', 'url', 'description'])                     ->load()                     ->getSelect()->__toString();                 var_dump($  _cat); die;             }             $  path['product'] = array('label'=>$  this->getProduct()->getName());         }          $  this->_categoryPath = $  path; 

but this does not work. How can I specify what entities are loaded in order to keep load to DB as low as possible for this requests? To load the whole category all the time is a lot of traffic, or can it be ignored completely?

Redirect Search link to specific Category search

I simply want to redirect all search link on my post to custom category search.

E.g I have a category named wordpress, and posts on the category already contains links to search example.com/search/keyword/ I want it to be redirected to example.com/wordpress/?s=keyword

Is there anyway to achieve this Please help me out.

Thanks in advance

Magento REST API Post Product and Category without “Sorting” parameter

I need to POST products with their category number, but without their sorting because I dont want to change the sorting via API.

{"product": {     "id": 1234,     "sku": "2345",     "name": "Nice Product",     "extension_attributes": {         "website_ids": [1],         "category_links": [{             "position": 11,             "category_id": "123"         }]     }} } 

As soon as I take our the sorting I get an error.

How to separate WooCommerce category and product page for showcase and shop?

I want to separate WooCommerce category and product page for showcase and shop without create double products and category.

I set /category/ in permalink settings for showcase,

Ex. /category/male /category/female 

where male/female WooCommerce product category

Now I want separate shop with url like this,

/shop/male /shop/female 

with same product category

Does it possible without create duplicate category?

If anyone has any advice that would be greatly appreciated.

Add custom category name as data-filter to switch between these categories

I have a portfolio page where I would like to place three buttons that will switch between different categories. I am using data-filer to sort them into different projects. I am thinking, how can I give this data-filter a category name, so it would switch depending what category and also when adding new post (project) and using any custom category, it would place it right in that portfolio section.

For this page I have this code:

<?php  get_header(); ?>   <div class="container projects-container">  <div class="gallery-nav" align="center">    <button class="btn btn-default filter-button gallery-link" data-filter="all">All</button>    <button class="btn btn-default filter-button gallery-link" data-filter="architecture">Architecture</button>    <button class="btn btn-default filter-button gallery-link" data-filter="furniture">Furniture</button>   </div>   <div class="row">    <?php    $  subs = new WP_Query(      array(        'post_parent' => $  post->post,        'post_type' => 'post',        'meta_key' => '_thumbnail_id'      )   );   if( $  subs->have_posts() ) :      while( $  subs->have_posts() ) :        $  subs->the_post(); ?>    <div class="col-sm-12 col-md-6 col-lg-4 cover-img filter">         <a href="<?php the_permalink(); ?>">       <?php the_post_thumbnail('post-thumbnail', ['class' => 'img-fluid']); ?></a>   </div>   <?php endwhile; ?>  <?php endif; ?>  <?php get_footer(); 

And this jQuery code:

jQuery(document).ready(function(){    $  (".filter-button").click(function(){       var value = $  (this).attr('data-filter');        if(value == "all")       {           $  ('.filter').show('1000');       }       else       {          $  (".filter").not('.'+value).hide('3000');         $  ('.filter').filter('.'+value).show('3000');        }   });    if ($  (".filter-button").removeClass("active")) {    $  (this).removeClass("active");    }    $  (this).addClass("active");  });