Category Listing pricing display changes

  • Posts: 20
  • Thank you received: 0
11 years 4 months ago #110634

Hello - I have been setting up a different "per_unit" display for a specific category of products, using this previous forum guide: http://www.hikashop.com/en/forum/4-how-to/51395-change-per-unit-into-per-set-per-length-per-reel.html.

The product page currently displays the right information: it shows information for a certain quantity, and info for a larger quantity order. However, this information isn't showing correctly on the category listing. Please see the example in this subcategory (of the main category, "Roving"):
http://www.bellwetherwool.com/index.php/roving/roving-colors/category/24-blues-group

Also, I require customers to order a minimum of 4 of any one product in this category and subcategories. Is there a way to display a notice when they click "add to cart" that reminds them of this requirement? For example, I'd like to list these products on the home page under featured products, but it is a little wordy to always display "minimum order of 4 oz. for any one color" under each item. That would be ok if there are no other options, but I'd love to find another way.

Thanks for your help!

Please Log in or Create an account to join the conversation.

  • Posts: 2334
  • Thank you received: 403
11 years 4 months ago #110701

Hi there,

About the first, the price displayed for these both views is based on the same file which is listing_price. So, you should take a look to be sure you edited the right view and also check the translation.
For the minimum quantity, this will require some good php knowledge because it's not something available in Hikashop and you have to code it yourself.
If you feel confident I can give you some advice otherwise I would suggest you to ask on the commercial jobs forum ;)

Please Log in or Create an account to join the conversation.

  • Posts: 20
  • Thank you received: 0
11 years 4 months ago #111153

Hi Eliot,

Thanks for the info - if you can give me some advice on the listing_price php, that would help a lot. I have been editing the listing_price php, but was unable to figure out how to fix things in the category listing part.

Here is my code for the price info:

if(isset($price->price_min_quantity) && empty($this->cart_product_price) && $this->params->get('per_unit',1))
      {
        if ($this->element->price_per == 'per ounce')
        {
           if($price->price_min_quantity>3 && $price->price_min_quantity<16)
           {
           echo "per ounce, minimum order of 4 oz. for any one color";
           echo JText::sprintf('PER_UNIT_AT_LEAST_X_BOUGHT',$price->price_min_quantity);
           }
           else if($price->price_min_quantity>15)
           {
           echo "per ounce for orders of 16 oz. (1 pound) or more";
           echo JText::sprintf('PER_UNIT_AT_LEAST_X_BOUGHT',$price->price_min_quantity);
           }
        }
        else
        {
          if($price->price_min_quantity>1)
          {
          echo " per ounce";
          }
          else
          {
            echo JText::_('PER_UNIT');
          }
        }
      }

Do I need to put in a line for: $this->row->price_per == 'per ounce'?

Last edit: 11 years 4 months ago by tandreas6.

Please Log in or Create an account to join the conversation.

  • Posts: 82758
  • Thank you received: 13346
  • MODERATOR
11 years 4 months ago #111355

Instead of:
if ($this->element->price_per == 'per ounce')

you should use:
if ($this->row->price_per == 'per ounce')

That way, it will work for both the product page and the listing.

Please Log in or Create an account to join the conversation.

Time to create page: 0.068 seconds
Powered by Kunena Forum