Forum Replies Created

Viewing 15 replies - 1 through 15 (of 183 total)
  • Plugin Author Mark Tomlinson

    (@marktomlinson)

    🙂

    Plugin Author Mark Tomlinson

    (@marktomlinson)

    Hmm.

    You mention

    On backend everything’s working fine regular prices show different for different variations

    Since all Markup-by-Attribute does is change the price of the variations and doesn’t interact with your shopping cart at all, I’d be concerned that the other plug-in is not accepting that variation price regardless of how it’s set. In fact, the example page above only shows “£20.00″. The way WooCommerce works, it should show “£20.00 — £50.00”, since that is the range of the product variations.

    I’ve never used the Ultimate Product Options Plugin, but it appears to me that it sets and calculates a price, regardless of the price in the database. Like there is some formula you have to set up for each product. If that’s the case, the Markup-by-Attribute plugin might be redundant.

    Sorry I couldn’t be more help.

    Plugin Author Mark Tomlinson

    (@marktomlinson)

    Frustrating.

    So, I’m consolidating all the definitions of the constants to a single routine, right up front. That should take care of it. I’ll have that ready within a few hours.

    Plugin Author Mark Tomlinson

    (@marktomlinson)

    Thanks for catching that. My PHP is at 7.2.24 and does not throw an error, even though I believe it probably should.

    Without getting too much into the weeds, I was using a constant named ATTRB_MARKUP_DESC_END, when I should have used one named ATTRB_MARKUP_END. Long story, but it essentially works the same regardless if the constant is spelled correctly or not. The constant was coded as a fail-safe, but caused an error of its own in some versions of PHP.

    I’ve fixed it and will be test and roll out the fix by the end of day.

    EDIT: Sorry, the reason it didn’t throw an error is because it is in a database update routine that only is run once if you are at an old version of the database. No wonder it didn’t show up in testing.

    Plugin Author Mark Tomlinson

    (@marktomlinson)

    Thank you!

    Plugin Author Mark Tomlinson

    (@marktomlinson)

    WooCommerce provides the Set regular prices function on the Variations, https://docs.woocommerce.com/document/variable-product/#section-9

    Markup by Attribute plugs into this function. It will not change prices that are manually set.

    Plugin Author Mark Tomlinson

    (@marktomlinson)

    The plugin only calculates against the base price. Multiple markups are allowed, but it does not maintain a running total for calculating the next markup.

    Sorry I couldn’t be more helpful.

    Plugin Author Mark Tomlinson

    (@marktomlinson)

    Good to hear!

    Plugin Author Mark Tomlinson

    (@marktomlinson)

    I wasn’t able to see the page because you have it locked from public view right now. But I do have some ideas of what the cause may be.

    How many is several hundred? My experience has shown that WooCommerce can only handle about 500 variations before it dies. This is due to a server timeout (usually 30 seconds of processor time) that prevents scripts from running perpetually. You can check if that is the problem by setting WordPress to capture a debug.log and looking for line that looks similar to this,
    PHP Fatal error: Maximum execution time of 30 seconds exceeded in ...

    The other thing it could be is if you have any ‘Any’ variations. For instance, if a certain pattern of fabric for a shirt contains a markup, but there is a variation set to ‘Any pattern’, then WooCommerce will select that one regardless of what other variations exist. This is easy to confirm because the ‘Any’ variations usually are sorted near the front. Also, if this is the problem, you will see variations with the correct prices in the admin console, but they will not be selected when you visit the store.

    I hope this helped.

    Plugin Author Mark Tomlinson

    (@marktomlinson)

    You’re welcome! Glad you fixed it.

    Plugin Author Mark Tomlinson

    (@marktomlinson)

    Here’s what that answers for me.

    Since the dropdown is working that shows that there is nothing wrong with the plugin installation and the attributes are being updated correctly. But the dropdown is updated in real time in the store, while the prices are adjusted on the database when the [Set regular prices] function is run. That narrows the scope of the problem to one module, “/src/product.php”.

    Since you disabled any other plugins, it isn’t a conflict or prioritization problem with another plugin. That tells me the problem is probably not how the plugin hooks into WooCommerce.

    So, the next question is one I think you would have mentioned, but I need to ask anyway. When you run [Set regular prices], how long does it take to finish? With 12 variations, I think it should be fairly quick. However, does it appear to run forever and you have to refresh the page to make the little in-progress indicator go away? If so, that would indicate an abend.

    The only way we’ll find an abend is by turning on the WordPress debug log. Here’s how to enable the debug.log; https://wordpress.org/support/article/debugging-in-wordpress/. However, I’ve found it is generally easier to just use a plugin. I use WP Debugging at https://wordpress.org/plugins/wp-debugging/.

    If it appears to be abending, can you clear the log, run [Set regular prices], and then send whatever errors you receive to markupbyattribute@mail.com? I don’t want you posting the error log here because you might inadvertently expose sensitive information.

    Thanks for your patience.

    Plugin Author Mark Tomlinson

    (@marktomlinson)

    The delimiter does not make any difference to the plugin. That is really just a display format managed by the WooCommerce currency settings. And yes, you should have 12 variations because you have three options (Type) times four options (Technique).

    It sounds like you are doing everything correctly. You must have created global attributes, or you would not have been able to set the markup. You must be using variable products, or you wouldn’t have any variations. You must have checked the Used for variations box when adding the attributes to the product, or the [Create variations from all attributes] functions would not have worked. And, you mention that you “set regular price”, so I assume you mean you are using the [Set regular prices] function. That’s really all there is to using Markup by Attribute.

    Does the description of any variation change? If you’re using the default settings of Markup by Attribute, you should see an explanation of the markup added to the description of the variations that have a markup. If the description changed but the price did not, then the problem is somewhere inside the plugin. If none of the descriptions changed, then it’s probable that the plugin is not being invoked or being invoked out of order (due to, perhaps, a conflict with another plugin).

    Plugin Author Mark Tomlinson

    (@marktomlinson)

    I’ll answer your last question first. The base price is the price without any options selected. So, in your example, selecting the size does not set the base price. Let’s say that your base price is $80 and 20″ has no markup, whereas 22″ has a $20 markup, yielding $100 for 22″. The 20% markup for Red would be calculated off $80, for a total of $116.

    I’ve considered methods of prioritizing the attributes so that you can do cumulative calculations, but that would require extensive changes to the plugin which I do not believe I can support. You may be better off with a plugin that applies a user-defined formula to a ‘Simple product’, rather than Markup by Attribute, which requires a ‘Variable product’.

    To your first concern: Markup by Attribute uses global attributes and variable products. I’ve written some usage instructions that contains links to the relevant areas of the WooCommerce documentation. The [Set regular prices] function appears on the Variations tab of a variable product.

    I hope that was helpful.

    Plugin Author Mark Tomlinson

    (@marktomlinson)

    I never learned from the original poster how they resolved their issue. However, when I’ve seen this before, it’s usually a matter of not running the [Set regular prices] function after adding the markup to the attribute. This is because the plugin hooks into the [Set regular prices] and [Set sale prices] functions.

    Plugin Author Mark Tomlinson

    (@marktomlinson)

    Glad you did! Thanks for using the plugin.

Viewing 15 replies - 1 through 15 (of 183 total)