• Resolved markisu72

    (@markisu72)


    Hi,
    is it possible to use filters to modify the content of the cart and checkout block like e.g. for the standard cart?

    There you could use e.g.

    add_filter( ‘woocommerce_cart_item_thumbnail’, ‘my_function’, 10, 3 );

    to modify the thumbnail.
    It that possible with the blocks?
    If so, is there a documentation or can I see it somewhere in the code?

    Thanks
    Markus

Viewing 5 replies - 1 through 5 (of 5 total)
  • Saif

    (@babylon1999)

    Hello @markisu72,

    is it possible to use filters to modify the content of the cart and checkout block like e.g. for the standard cart?

    Yes, but not all WooCommerce hooks will work with the cart block.

    If you’d like to learn more about the limits of customising WooCommerce blocks, you can check this part of the GitHub repository.

    Cheers!

    Thread Starter markisu72

    (@markisu72)

    Hey @babylon1999 ,

    thanks for your quick response – that documentation was the one I have been looking for!

    If I am not fully mistaken, then the image cannot be manipulated, correct?
    Unfortunately exactly this would be one of our use cases…

    Thanks
    Markus

    Saif

    (@babylon1999)

    If I am not fully mistaken, then the image cannot be manipulated, correct?

    I wasn’t able to find a ready-to-use hook to change the thumbnails too, but this can be a great enhancement request.

    Feel free to submit it in the GitHub repository as an issues report or on on the extension’s page. : )

    Alternatively, you might be able to manipulate the images programmatically by editing the site files. If you’re not comfortable doing this yourself, you can hire a developer from Codable.

    Cheers!

    Thread Starter markisu72

    (@markisu72)

    Hey @babylon1999 ,

    I’ve been experimenting with the blocks filters described here.
    Or at least, I tried.

    I fear, I am lacking some information.
    Am I right, that these examples is JS to be executed in the browser?
    I am trying to include them as JS using WPCode but actually – while not producing any JS error – they don’t do nothing at all, even though they are part of the page.

    E.g this should at least to something when I display the basket, right?
    I feel really stupid, because I don’t anything to work at all. I either get JS errors or no errors but no impact.

    I find it quite difficult to find at least a very simple and working starting point from where I can dig deeper.

    Is there any further documentation / starter guide for dummies?
    It seems like this kind of customisations are not very common yet.

    Thanks

    Markus

    Hello,

    Am I right, that these examples is JS to be executed in the browser?

    This is PHP code, to add PHP code into your site you can explore these alternatives explained below:

    How to Easily Add Custom Code in WordPress (Without Breaking Your Site).

    Hope this helps.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘WooCommerce Cart and Checkout blocks / filters’ is closed to new replies.