• Hi,

    No need to explain why this plugin is extraordinary, but I have a question. I’m creating a shop with product categories and in a specific category I put a button on the product page. This button has to change the product categories of this product. So my question is: which function can add a product category to a product and remove the current category ?

    Thanks for your answer

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello there,

    This button has to change the product categories of this product.

    Just to be sure in order to provide better assistance. May I ask the reason to change the product category? Can you provide an example, please?

    Thread Starter natelvl

    (@natelvl)

    In my shop, I have products with a calibration date so they have experation date and when the time comes those products change automatically in an other category, named “Expired”, but in order to calibrate them i need to put them in metrology. So I programmed a button in the product pages. This button appears only if products are in the category “Expired”. This button has to change category from “Expired” to “Metrology”.
    We can change the product category in backend so I assume that there is a code or a function in order to change the category. Is it possible to apply this code to my button ?

    Thanks for your answer

    Plugin Support nicw.a11n

    (@nicw)

    Hi @natelvl

    As I understand it, you want visitors to your website to be able to change the category of a product by clicking a button on the page displaying that product.

    Products use a custom taxonomy for their categories. What you want to do can be done, but it is a fairly complex development topic. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    I can also recommend the WooCommerce Developer Resources Portal for resources on developing for WooCommerce.

    You can also visit the WooCommerce Facebook group or the #developers channel of the WooCommerce Community Slack. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Excellent plugin but need help’ is closed to new replies.