Display of product name and variant

  • Posts: 26
  • Thank you received: 0
11 years 5 months ago #109856

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.

  • Posts: 12953
  • Thank you received: 1778
11 years 5 months ago #109858

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.

  • Posts: 26
  • Thank you received: 0
11 years 5 months ago #109864

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.

  • Posts: 12953
  • Thank you received: 1778
11 years 5 months ago #109878

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 :

<?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 :
<?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: 11 years 5 months ago by Mohamed Thelji.

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

  • Posts: 26
  • Thank you received: 0
11 years 5 months ago #109902

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.

  • Posts: 12953
  • Thank you received: 1778
11 years 5 months ago #109906

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.

  • Posts: 26
  • Thank you received: 0
11 years 5 months ago #109908

Thanks again for the fantastic support

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

  • Posts: 332
  • Thank you received: 6
10 years 11 months ago #137640

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.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
10 years 11 months ago #137645

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.

  • Posts: 332
  • Thank you received: 6
10 years 11 months ago #137647

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.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
10 years 10 months ago #137728

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.092 seconds
Powered by Kunena Forum