Removing or styling Product Qty

  • Posts: 9
  • Thank you received: 0
4 years 6 months ago #323877

-- HikaShop version -- : 4.3.0
-- Joomla version -- : 2.5.28
-- PHP version -- : 5.6.40
-- Browser(s) name and version -- : Firefox 80.0.1

Background:
I am responsible for maintaining a legacy website. This means that the client is VERY resistant to change so updates only occur when absolutely necessary.
My skills as a web designer are limited and my grasp of .php is negligent but I fumble through. :dry:

WAS working with Joomla 2.5.28 and Hikashop 2.3.5

Something changed recently (probably hosting configuration) that meant that I was no longer able to add or edit products. (gives a 403 error on creation/edit or even cancel)

So....was able to convince client that it was time to upgrade. Upgrading fixed the issue but....because of the extreme change in versions I am now faced with re-styling MANY of the features of the webpage to get things back to looking the way they did. :angry:

Currently redoing everything with Joomla 2.5.28 and Hikashop 4.3.0

Issue:
In the previous version I was able to hide the Qty by editing the (X_ITEMS_IN_STOCK) in the language file. Additionally the program provided a class (.hikashop_product_no_stock) when there were no items in stock that allowed me to style something when it was sold out.

See example:



The new version does not do this!! Editing the language file does not hide the Qty. and the out of stock class is not created. Can someone help me figure out how to duplicate the results of the previous version?

Attachments:
Last edit: 4 years 6 months ago by DSCulp. Reason: Bad formatting, confusing

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

  • Posts: 83407
  • Thank you received: 13500
  • MODERATOR
4 years 6 months ago #323878

Hi,

Translation override is still the way to go.
Note that before there was only one translation key to change but there are now two: one for the quantity is 1 and one when it's more than one. That was changed years ago so that the text could handle the singular/plurar.

Now you're right that the hikashop_product_no_stock class is gone.
But you can add one if you want by adding a translation override on NO_STOCK. For example:

NO_STOCK="<span class='hikashop_product_no_stock'>No stock</span>"

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

  • Posts: 9
  • Thank you received: 0
4 years 6 months ago #323889

Excellent, that solved part of the problem but the translation override for X_ITEMS_IN_STOCK doesn't seem to hide the Qty like it used to.

I tried to do it with X_ITEMS_IN_STOCK="" (used to work) and then tried .hikashop_product_stock_count {display: none} in my .css but that hides everything, including the NO_STOCK option. :(

To recap:
I would like to hide the Qty when there are items in stock and show SORRY IT'S SOLD when we are sold out.

Thank you so much for your help so far!! Certainly didn't think about embedding .css in the language override so that was a revelation!! :woohoo:

Last edit: 4 years 6 months ago by DSCulp. Reason: correction

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

  • Posts: 9
  • Thank you received: 0
4 years 6 months ago #323896

Nevermind, I got it!! :woohoo:

Again, thanks to you! I couldn't figure out what was going on. The Qty string appeared to be hardcoded since nothing I did would change it.

Then I reread your comment:
"Note that before there was only one translation key to change but there are now two: one for the quantity is 1 and one when it's more than one. That was changed years ago so that the text could handle the singular/plurar."

I realized that my Language file only had ONE entry for Qty and I had been making all of the changes to the X_ITEMS_IN_STOCK and I only had single items. Adding the second entry for single items and then altering it to X_ITEM_IN_STOCK="" did the trick, just like it used to!! :cheer:

Last edit: 4 years 6 months ago by DSCulp.

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

Time to create page: 0.090 seconds
Powered by Kunena Forum