Characteristics with Dynamic Variants

  • Posts: 149
  • Thank you received: 0
12 years 11 months ago #32411

Hi,

I am interested in creating a characteristic called "Batch". This batch needs to be used as an internal separator for the products of the same type.


Example:
Product: "Nike Shoes - Model 1"
Total Stock: 100
Batch Stock
00100 30
00110 40
11001 30

As you can understand the batch numbers are specific per product therefore we cannot pre-create them on the characteristic.

Can you advice if this can be somehow implemented in Hikashop

Thanks

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
12 years 11 months ago #32429

Hi,

You could have numbers for your characteristic values: batch 1, batch 2, batch 3
Then, in each variant, you could put the batch number as product code or product name.

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

  • Posts: 149
  • Thank you received: 0
12 years 11 months ago #32506

Hi Nikolas,

I am not sure I understand the solution.
I have checked the tables in the database and they are as below:

"hikashop_characteristic"


characteristic_id characteristic_parent_id characteristic_value


"hikashop_variant"
variant_characteristic_id variant_product_id ordering

As I can understand from above structure of the tables, we cannot keep value at the variant level. It only keeps the relation of the characteristics and the products. Can you explain where I can keep the variant name

Thanks

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
12 years 11 months ago #32530

Each variant of a product is stored in the product table as a normal product.
So you will have entries in the variant table linking the main product and the characteristics and you will also have entry in the variant table linking the variants and the characteristics values.

You can click on the "manage variants" button on your product edition page to access the listing of variants of your product and modify the information of the variants there.

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

  • Posts: 149
  • Thank you received: 0
12 years 11 months ago #32614

Hi Nikolas,

I have created the below configuration in hikashop.
1. Create Characteristic "Batch No"
2. Characteristic "Batch No" has values : "Batch 1", "Batch 2", "Batch 3", "Batch 4", "Batch 5" (as the most batches a product can has is five)

I want to achieve the below:
1. Display "Batch No" characteristic (with the stock number) only to "Wholesalers group". We have already implemented this for the regular stock of a product by adding the code in front\views\product\tmpl\quantity.php line 56:
if(hikashop_isAllowed('<group id>')) {
.....
}

Can you advice where the variants are displayed so we can add the same code as well

2. In the product detail page I would like to display the variant code instead of the variant value from the characteristic. Can you advice how this can be implemented

Thanks

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

  • Posts: 149
  • Thank you received: 0
12 years 11 months ago #32617

Hi,

Point 1 from previous post is already enforced by previous solution for the general stock. We only need to enforce access on the specific group on each variant for each product.

Can you provide a solution for the second point

Thanks

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
12 years 11 months ago #32655

Hi,

The variant information is displayed by the file components/com_hikashop/views/product/tmpl/show.php. Note that view files should be edited via the menu Display->Views so that you don't loose your changes when you update HikaShop.

However, the characteristics dropdowns are displayed by the file administrator/components/com_hikashop/types/characteristic.php
It can also be overridden but it can't be done via the interface:
www.hikashop.com/en/support/documentatio...tation.html#override

For the variant name, you will find that line:
<?php echo $variant->product_name;?>
in the file components/com_hikashop/views/product/tmpl/show.php

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

Time to create page: 0.066 seconds
Powered by Kunena Forum