Skip to main content

Display of product name and variant

More
13 years 3 months ago #109856 by Kes
Some of my products have variants. I have been putting the products into HikaShop by using 'copy'. (I have HikaShop Commercial). When you choose a variant on a product page you get a product name like:

Birthday Girls - July/Cornelian AM825_4_copy14540

These long product codes also show up in the shopping cart.

Can I control the display so that the customer only sees the basic product code, AM825 in the above case.

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

More
13 years 3 months ago #109858 by Mohamed Thelji
Hi,

I think that the best solution will just be to directly change your product code through your product/variant page.

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

More
13 years 3 months ago #109864 by Kes
Thanks for that.

But product codes have to be unique? Is it too difficult to change what is displayed on the product page and in the shopping cart?

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

More
13 years 3 months ago - 13 years 3 months ago #109878 by Mohamed Thelji
Hi,

No, you'll just have to edit the show_default file of your "product" view of your front-end template and change these lines :
Code:
<?php if ($this->config->get('show_code')) { ?> <span id="hikashop_product_code_main" class="hikashop_product_code_main"> <?php echo $this->element->product_code; ?> </span> <?php } ?>
by :
Code:
<?php if ($this->config->get('show_code')) { ?> <span id="hikashop_product_code_main" class="hikashop_product_code_main"> <?php echo substr($this->element->product_code, 0, NUMBER_OF_CHARACTER_OF_YOUR_PRODUCT_CODE); ?> </span> <?php } ?>
And it should do the job, but you'll have the replace NUMBER_OF_CHARACTER_OF_YOUR_PRODUCT_CODEby the number of character that you want for your product code.
Last edit: 13 years 3 months ago by Mohamed Thelji.

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

More
13 years 3 months ago #109902 by Kes
Hi

Thank you. I have put that into the module, but I made one small change. I took out the two ' characters.

I have also put the same change into the 'show' and 'cart' modules so that you see the same codes after you choose a variant and in the shopping cart. It seems to be working. Was this correct?

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

More
13 years 3 months ago #109906 by Mohamed Thelji
Sure :). (I edited my last post and corrected it).
The following user(s) said Thank You: Kes

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

More
13 years 3 months ago #109908 by Kes
Thanks again for the fantastic support

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

More
12 years 9 months ago #137640 by LukeDouglas
I changed the show-default.php page as instructed in this thread and where the main product name was changed from American Eagle to Audrey Hepburn, the variant code as generated still shows American Eagle plus all of these copies?



I know I can 'manually' changed the variant code but when you have a few hundred that you are copying due to the 'same' variant setup for sizes, it's a pain! :angry:

Is there anyway to simply have the main product code, ie: audrey-hepburn, used in the variant code with a sequenced number added, ie: audrey-hepburn-137, audrey-hepburn-138, audrey-hepburn-139, etc.?

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

More
12 years 9 months ago #137645 by nicolas
There is no option to dynamically change the product_code of all the variants of a product based on the product_code of the main product.

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

More
12 years 9 months ago #137647 by LukeDouglas
Bummer! Nick, add this to your 'request' list. If someone copies a product and you changed the title of the copied product, a simple subroutine could generate a product code based on the title, ie: The Grapes of Wrath = the-grapes-of-wrath and then change the code for all variants, ie: the-grapes-of-wrath-148, the-grapes-of-wrath-149, the-grapes-of-wrath-150, using a global sequence number. It would save a 'lot' of time when you are duplicating products. :)

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

More
12 years 9 months ago #137728 by nicolas
Yes, we'll have that for the product_code in next version so that if you update the product_code of the main product, it updates the product_code of all the variants based on that change.

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

Time to create page: 0.224 seconds
Powered by Kunena Forum