Mark-Tomlinson / markup-by-attribute-for-woocommerce

Price markup by attribute term for WooCommerce
GNU General Public License v3.0
3 stars 3 forks source link

Fixed markup attribute on product page #22

Closed Mihir7 closed 3 years ago

Mihir7 commented 3 years ago

Hi Mark,

I want to hardcode and show this markup attributes fixed on all products, no matter what other variations are selected for the product.

Eg - I have 2 variations for a product - all of which have same price, so user can select whichever they want price remains same. All the products on the site has same price and variation.

Then the 3rd variation - has 4 options - which has different markup added. Which I want to add to the above sale price, no matter what other variation user has selected. Just increase the price for this attribute.

How can I hardcode this so it is shown on every product on the site.

Thanks.

Mark-Tomlinson commented 3 years ago

I don't believe I am understanding the question. It sounds like you could simply not set a markup for attributes #1 and #2. If you actually want to see a markup for attributes #1 and #2, then you would set all terms to the same markup.

Mihir7 commented 3 years ago

I am not setting the markup for attribute 1 and 2. Let me explain with example -

1st attribute (no markup) - Color - Lots of colors 2nd attribute (no markup) - size - Lots of Sizes

3rd attribute (have markup) - spice - little, medium, high

No matter what the customer selects for the first and second attribute, price remains the same for the product. when the customer selects the "spice" I increase the price with the markup I set with the help of your plugin.

Since the spice attribute is totally independent of others, how can we hardcode "spice" on the product page so it appears on all the products on the site. Instead of making variations for all the products.

Mark-Tomlinson commented 3 years ago

Ah, you are asking a question about WooCommerce, rather than one regarding the plug-in. Markup-by-Attribute works within the framework provided by WooCommerce, and variable products are the only way I can make it work within that structure.

That said, you really only need to create three variations for each product. Here's how I would do that.

  1. Add all three attributes to the product, but only check Used for variations on Spice.
  2. On the Variations tab, Create variations from all attributes. This will only create three variations, but Spice will be your only option.
  3. Go back to the Attributes tab and select Used for variations for Color and Size. This is required to make Color and Size show on the product page.
  4. You can Set regular prices at any point after the three variations have been created.

Hope that helps.

Mihir7 commented 3 years ago

Hi mark, the way you mentioned it, it helps a lot as now I have to create only 3 variation instead of 50+.

The only problem I am facing after doing this is - when a user selects color or size (1st and 2nd attribute options) from dropdown, the correct product image is not loaded on side. (eg - if user selects blue, blue product image is not shown)

This error happens after I delete and create variations from all to add the 3rd spice variation to it. Any Ideas.

Mark-Tomlinson commented 3 years ago

Yes, this is not an error. It is because the color image is stored with the product variation. Of course, my plugin does not control such things, so I'm a little out of my purview here. But, I know people using the plugin who have well over 50 variations.

Mihir7 commented 3 years ago

Thanks a lot for replying @Mark-Tomlinson

Yes as you said, I have color image already stored with variations, Now when I -

  1. create variations from all attributes to add the Spice attribute - All color images are gone for the variations. Since there are around 50 variations cannot add images to all again.

  2. When I Add the 3rd attribute spice and select used for variation - IN variations tab I see "Any Spice" added to already created variation. Here the color images are still there but when I select the spice options markup is not added to the price as "any spice" is there in the variation.

So how do other guys who have over 50 variations add a new attribute variation. They also must be losing the color image set in variation right?

Mark-Tomlinson commented 3 years ago

I suppose. May I suggest the WooCommerce documentation on variable products and attributes? This is not something I'm familiar with.