News:

Support the VirtueMart project and become a member

Main Menu

Banner over image after click add to cart - can anybody have solution?

Started by nonki212, January 20, 2018, 22:29:38 PM

Previous topic - Next topic

nonki212

virtuemart 3.2 12
hello
i am looking for a code to add, or change, so when my clients add a product to cart, a banner over the thumb image will display.
see attached for the sample.
if anybody knows what to change and how, please respond.
i know there is css to do it, but i am not that good in coding
Adi

Studio 42

This is not so simple, because added to order, need to check the product in cart

nonki212

thank you
i thought to write "IF" product is in cart, then change image or add image on top.
but thank you.
Adi

Studio 42

$cart = VirtueMartCart::getCart(false);
foreach ($cart->cartProductsData() as $cartProduct) {
if($cartProduct['virtuemart_product_id'] == $product->virtuemart_product_id){
// yourcode here
}
Some code is certainly missing and i dont tried, but you should cache this and not run this for each product.

nonki212

Adi