VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product creation => Topic started by: thanili on July 25, 2013, 13:20:45 PM

Title: remove cart attributes with specific value from cart!
Post by: thanili on July 25, 2013, 13:20:45 PM
Hello guys,

I am trying to figure out how i could remove from shopping cart view, cart attributes (boolean) with '0' value.

Check screenshot 1, where is the product configuration. There are 6 optional (No/Yes) boolean cart attributes.

Check screenshot 2, where the shopping cart is shown. I would like to remove all rows that represent cart attributes not selected by user.

So, i would like to have only "Base Size 46, Additional Size 38, Additional Size 42" in the shopping cart.

I think that the associated file is \templates\my_template\html\com_virtuemart\cart\default_pricelist.php

where in line ~ 155:

<span class="cart-images">
<?php
if (!empty($prow->image)) {
echo $prow->image->displayMediaThumb (''FALSE);
}
?>

</span>
<?php ?>
<?php 
//HERE WE PRINT THE ITEMS!!!! WE SHOULD CHECK IF BINARY AND VALUE IS ZERO DO NOT PRINT!!!
echo JHTML::link ($prow->url$prow->product_name) . $prow->customfields?>


But where i can alter $prow->customfields content ? or how can i make in this place?


[attachment cleanup by admin]
Title: Re: remove cart attributes with specific value from cart!
Post by: Maxim Pishnyak on July 25, 2013, 16:27:49 PM
Why base size is not a parent product and add size is not a child product?
Title: Re: remove cart attributes with specific value from cart!
Post by: thanili on July 25, 2013, 16:49:32 PM
Because when i asked the same question in this forum nobody replied :) ...

all these products are electronic and i bought the digitoll plugin in order to implement it ... it is very easy to just add cart attributes in order to have downloable additional options for each product ...
Title: Re: remove cart attributes with specific value from cart!
Post by: Maxim Pishnyak on July 26, 2013, 00:06:11 AM
Quote from: thanili on July 25, 2013, 16:49:32 PM
easy
I couldn't guarantee that everything will be easy, but still almost everything is possible.

Let's start with parent/childs?
Title: Re: remove cart attributes with specific value from cart!
Post by: thanili on July 26, 2013, 14:46:31 PM
OK Maxim...

so if i have 1 parent product with 4 child products could the visitor select to buy the parent product and multiple chlid products?

if yes i will give it a try ...
Title: Re: remove cart attributes with specific value from cart!
Post by: Maxim Pishnyak on July 26, 2013, 16:20:52 PM
What is the point of parent product in your case? Could you elaborate more?
For example could be parent ordered alone?

Also see what could propose you custom extension called Catproduct.
Title: Re: remove cart attributes with specific value from cart!
Post by: thanili on July 26, 2013, 16:24:21 PM
OK the case is the following:

e-products are selled which are fashion designs. Each product has a base size (e.g. 38) which costs "A" <- Base (or parent(?)) product/size

user must be able to select additional sizes to buy (e.g. 40,42,44,46,48) each one costing "B" <- Additional (or child(?)) products/sizes

i think it is clear ...



Title: Re: remove cart attributes with specific value from cart!
Post by: Maxim Pishnyak on July 26, 2013, 16:46:53 PM
Ok, so try to make one demo parent+childs product somewhere. And see what is it.

I just not sure what layout do you want in a result.