Display available quantity but not price?

  • Posts: 42
  • Thank you received: 2
9 years 4 months ago #238746

-- HikaShop version -- : 2.6.2 (Business)
-- Joomla version -- : 3.5.1

Hi,
I have two user groups, "Wholesale" and "Retail". I would like to display Add to Cart, Price and Quantity Select to Wholesale, but only show Quantity available to Retail users. I'm currently able to limit Price/Add to Cart to Wholesale customers using ACL on the price of items, but am unsure how to display quantity to Retail under this configuration. Is there a way to accomplish everything I'm hoping to do using standard configuration options, or will I need to do some overrides?

Thanks
Matt


It's amazing how the omission of a semicolon can absolutely ruin an otherwise pleasant evening.
Last edit: 9 years 4 months ago by spoonbow.

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

  • Posts: 84311
  • Thank you received: 13701
  • MODERATOR
9 years 4 months ago #238769

Hi,

You'll need to do some overrides. I think you'll need to edit both the view file "show_default" (to add the display of the product quantity all the time:
<?php echo $this->element->product_quantity; ?>
and of the view file "quantity" to remove it from there so that you don't get it displayed twice for wholesale users.

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

  • Posts: 42
  • Thank you received: 2
9 years 4 months ago #238820

Nicolas,
Thanks for the quick reply. Instead of two modifications, is there an if statement in the "quantity" file that could be altered to show the quantity? I'm having a little difficulty tracking through all the conditional statements to see if there is one responsible for show/hide quantity.

Thanks,
Matt


It's amazing how the omission of a semicolon can absolutely ruin an otherwise pleasant evening.

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

  • Posts: 84311
  • Thank you received: 13701
  • MODERATOR
9 years 4 months ago #238841

Hi,

The stock is displayed together with the add to cart button in the quantity file. And the whole quantity file is displayed based on whether there are prices or not in the show_default file.
That's why it requires modifying both files for what you want since you only want to display the stock for when no price is found.

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

  • Posts: 42
  • Thank you received: 2
9 years 4 months ago #239446

Hi Nicolas,
Just getting back to this project. Any way of doing this and maintaining the AJAX updates when the user selects a different variant of the product?

Thanks
Matt


It's amazing how the omission of a semicolon can absolutely ruin an otherwise pleasant evening.

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

  • Posts: 84311
  • Thank you received: 13701
  • MODERATOR
9 years 4 months ago #239457

Hi,

Sure. Two things for that:
1. You want to display the quantity in the div <div id="hikashop_product_quantity_main" class="hikashop_product_quantity_main"> in the show_default view file.
2. You also want to display it in the div <div id="hikashop_product_quantity_<?php echo $variant_name;?>" style="display:none;"> in the file "show" of the view "product" (that's where the variants data is displayed).

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

Time to create page: 0.039 seconds
Powered by Kunena Forum