WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
WooCommerce product_category shortcode customisation (5 posts)

  1. Webcounties
    Member
    Posted 1 year ago #

    Hello

    I am going to have a few pages that use [product_category category="xxxxx"] in order to display products. I would like to add a “more info” box as well as change some of the HTML output of this shortcode slightly to make the products fit better on the page.

    Which PHP file & functions do I need to edit? I would imagine that the short-code calls a loop that then calls each product individually. The theme I am using (Mercor) does have lots of overrides so it may be that the layout is already customised a little, but I don't know which functions to look at.

    Regards

    Neil

    http://wordpress.org/extend/plugins/woocommerce/

  2. jameskoster
    Member
    Plugin Author

    Posted 1 year ago #

    I wouldn't really recommend editing shortcodes. If all you want to do is add content which not add it to the category description?

    Changing markup is also dangerous. The layout should be controlled via CSS to it's probably safer to adjust that rather than the markup.

  3. Webcounties
    Member
    Posted 1 year ago #

    Thank you for the quick reply jameskoster. I really would like a button that says info next to the Add to Cart button, but I don't think that could be done with CSS alone (although the rest can). I think I said box when I meant button.

    I can use a template override file so it will be easy to undo anything that does not have the desired affect. Do you know which PHP file I would need to use to create the template override?

  4. sparklyscotty
    Member
    Posted 7 months ago #

    Ditto! I'd like a more info button taht links to the product page next to the add to cart button.

  5. vark
    Member
    Posted 7 months ago #

    @sparkly,
    Why not copy the code which creates the 'product_category' shortcode into your theme functions file, and name it something like 'product_category2' (or whatever you like). Then you can make the changes you desire, and the new shortcode will be protected from being overwritten by future woo updates

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic