Characteristics and Variants with custom pricing

  • Posts: 1
  • Thank you received: 0
14 years 1 month ago #1238

Here is my use case

A customer adds a product (Large Pizza) and needs to add toppings, some are 1.25 and some are 1.50. I need the pizza to have one to many toppings.

I was able to add the product and a characteristic, but I am not able to select many variants to add to the product. Can this be done?

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

  • Posts: 83023
  • Thank you received: 13403
  • MODERATOR
14 years 1 month ago #1242

You would have to add several characteristics like topping one, topping two, topping three and then have the same values for all of them: no topping, cheese, ham, etc
Then, add all those characteristics to the pizza product and let the system generates all the variants by saving the product. Once done, you just need to set the prices for each possible combination.

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

  • Posts: 56
  • Thank you received: 0
11 years 3 months ago #121780

How do you do this quickly for multiple variants?
For example, I have rings that come in different colors. All ring sizes above 10.5 (to 15) are exactly $10 more for all models with all colors. Right now I am going in and adjusting the price for all 9 ring sizes for each color variant (e.g. Size 11 with the color red). This leads to adjusting the price by $10 for about 45 variants for each product. Is there a way, for example, to go into the master characteristic for "Ring Size" and say +$10 for this particular variant?

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

  • Posts: 26165
  • Thank you received: 4029
  • MODERATOR
11 years 3 months ago #121829

Hi,

In HikaShop we have a feature name "mass action".
It allows you to make a specific action (change the product price by a percentage or a fixed value) to several products in the same time using some kind of query.
You can test it in our demo website if you want to make some tries.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 56
  • Thank you received: 0
11 years 3 months ago #122006

I'm not 100% sure how this process would work. I've looked for documentation but haven't found any. This is what I have so far:

Trigger:
After a product is created

Filters:
Ring Size is >= 11

Actions:
Update the values
Price_value = ??

What do I put here to increase the variant price of all ring sizes 11 and up by $10 of the master price?

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

  • Posts: 83023
  • Thank you received: 13403
  • MODERATOR
11 years 3 months ago #122025

I don't think that using mass actions is a good idea.
Instead, you should not add both characteristic at the same time.
First, only add the size characteristic. Then, set the price for each size variant.
Then, add the color characteristic and the system will regenerate all the variants and keep the price to had for each size variant regardless of the color.
That way you save a lot of time.
Also, you can use the "copy" button of the products listing to duplicate a product and all its variants automatically into a new one if you have several products with the same prices/variants. That can save a lot of time.

The following user(s) said Thank You: viki667

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

  • Posts: 56
  • Thank you received: 0
11 years 3 months ago #122028

Hi Nicolas,
I guess it'd be simpler to just layout the problem in it's entirety for you since I'm talking to you about the same overall issue in two threads.

I have rings with two variants, color and size. Some of the colors have different pricing and I have pictures of that ring in that color option. Also, all sizes are 11 and up are $10 additional. I tried doing an import but apparently I can't control the image name which I use to describe the image being displayed (the image name is visible to the end user). So basically it looks like I can either do as you suggest and customize one set of variants and then go back in and manually adjust the excess created when I add the second characteristic (either way I'd be manually adjusting about 45 variants), or I can (I haven't tested this theory yet) manually enter the product with the images attached to the variants and manually naming them as I've been doing and then do an import to add the size characteristic with adjusted pricing. My hope is the system will update my existing product during the import instead of create a new one.

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

  • Posts: 83023
  • Thank you received: 13403
  • MODERATOR
11 years 3 months ago #122076

The import system is to import products/variants, not to update them.
If you want to update product/variant data via a partial CSV, in that case, you can use a mass action where you select a CSV as a product filter and then the system will partially update the product/variant data based on the data in the CSV.

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

  • Posts: 56
  • Thank you received: 0
11 years 3 months ago #122258

In that case, what would the action be?

Now in my mass action I have:

Trigger:
After a product is created

Filters:
CSV Products
In CSV of uploaded file (see linked)

Actions:
??

Last edit: 11 years 3 months ago by Lutya.

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

  • Posts: 83023
  • Thank you received: 13403
  • MODERATOR
11 years 3 months ago #122260

Yes. There is no action to enter. Actually you should not enter a trigger since you will process the mass action manually via the "process" button at the top.
Please make a backup before running such mass action because if there is a problem, in the configuration of the mass action, or a bug in the mass action system, it can rapidly destroy your hard work of product configuration.

The following user(s) said Thank You: Lutya

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

  • Posts: 56
  • Thank you received: 0
11 years 3 months ago #122273

I'm not sure what I'm doing wrong. I keep getting errors:

The line '' could not be imported Product not found

Warning: array_merge() [function.array-merge]: Argument #4 is not an array in /home/content/98/10133298/html/bellaraejewelry/administrator/components/com_hikashop/classes/massaction.php on line 1401

Warning: array_diff() [function.array-diff]: Argument #2 is not an array in /home/content/98/10133298/html/bellaraejewelry/administrator/components/com_hikashop/classes/massaction.php on line 1402

My CSV file is here .
And my product is here .

Also, if it helps, here is my product screen.
And here is my variant screen.

Last edit: 11 years 3 months ago by Lutya.

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

  • Posts: 56
  • Thank you received: 0
11 years 3 months ago #122617

Hey Nicolas,

Any ideas on what I'm doing wrong? This is literally the last part I have to do to finish up this site. Any direction would be greatly appreciated.

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

  • Posts: 83023
  • Thank you received: 13403
  • MODERATOR
11 years 3 months ago #122636

Your CSV is not valid. You need to either have the the product_code column and specify the product code of each variant in it.
Then, there is no need for the characteristic columns or the product_type, you just need to have the price_value and product_published columns.
Remember that this is an update system, not an product creation system so it assumes that the products/variants are already in the database.

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

  • Posts: 56
  • Thank you received: 0
11 years 3 months ago #122815

Thanks, I tried what you suggested and only included the price_value, product_published, and product_code columns. I still got the following error:

Warning: array_merge() [function.array-merge]: Argument #4 is not an array in /home/content/98/10133298/html/bellaraejewelry/administrator/components/com_hikashop/classes/massaction.php on line 1401

Warning: array_diff() [function.array-diff]: Argument #2 is not an array in /home/content/98/10133298/html/bellaraejewelry/administrator/components/com_hikashop/classes/massaction.php on line 1402

Warning: Invalid argument supplied for foreach() in /home/content/98/10133298/html/bellaraejewelry/plugins/hikashop/massaction_product/massaction_product.php on line 250

To be safe I added in the product_parent_id afterwards and still got the error. You can see the updated CSV file here . Thank you so much for your help thus far, I just can't wait to finish this site!

Last edit: 11 years 3 months ago by Lutya.

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

  • Posts: 2334
  • Thank you received: 403
11 years 3 months ago #122847

Hi there,

Could you please post here the lines which are in this file around the line 1401 so we can have an idea of where the error occurs? (the line numbers are different on customers end since we have comments).

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

  • Posts: 56
  • Thank you received: 0
11 years 3 months ago #122928

massaction.php line 1401 & 1402:

$mergedColumns = array_merge(array_keys($productColumns),array_keys($priceColumns),$categoryColumns,$characteristicColumns,$otherColumns);

$wrongColumns = array_diff($columns,$mergedColumns);

massaction_product.php line 250:
foreach($ids as $i => $id){
	$oldElement = $productClass->products[$id];

	if(!empty($data->elements[$id]->price_value)){
		$data->elements[$id]->prices = array();
		$price_values = explode('|',$data->elements[$id]->price_value);
		$price_currencies = explode('|',$data->elements[$id]->price_currency_id);
		$price_min_quantities = explode('|',$data->elements[$id]->price_min_quantity);
		$price_accesses = explode('|',$data->elements[$id]->price_access);

Last edit: 11 years 3 months ago by Lutya.

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

  • Posts: 26165
  • Thank you received: 4029
  • MODERATOR
11 years 3 months ago #123123

Hi,

For what I see, the CSV file is still not valid.
There is a space for all product_code, there is not quote at all and the text as "product_parent_id" could be a problem too.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 56
  • Thank you received: 0
11 years 3 months ago #123180

I removed the product_code spaces and deleted the "product_parent_id" column. Still getting these errors.

I have no idea what you mean by "there is not quote at all".

New CSV file

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

  • Posts: 26165
  • Thank you received: 4029
  • MODERATOR
11 years 3 months ago #123225

Hi,

The CSV format is a specific format, which have rules.
A text have to be between quotes.

"price_value","product_published","product_code"
130,1,"Rs-12Lg_19_49"
130,1,"Rs-12Lg_19_48"
If you have "float" number, you have to quote them too
"price_value","product_published","product_code"
"129.99",1,"Rs-12Lg_19_49"
"129.99",1,"Rs-12Lg_19_48"
Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 56
  • Thank you received: 0
11 years 3 months ago #123294

Ok, my file now appears the way you have shown and I am still getting the same errors:

"price_value","product_published","product_code"
130,1,"Rs-12Lg_19_49"
130,1,"Rs-12Lg_19_48"

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

Time to create page: 0.112 seconds
Powered by Kunena Forum