close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Find if dynamic value exists in cart

Thread began 3/13/2015 12:22 am by enquiry272230 | Last modified 3/17/2015 9:11 am by enquiry272230 | 1441 views | 6 replies

enquiry272230

Find if dynamic value exists in cart

HI,

I am presenting a popup page with some items to add to the cart that are reduced in price based on the particular item the customer has first added to the cart.

E.G. The customer adds a couch to the cart and because of that he gets a popup with reduced prices on some recommended cushions that he can then add to the cart also.

The problem I have is that the customer could add the reduced price item to the cart from the popup and then delete the original that enabled the reduced price items in the first place.

So therefore, I wish to hide the delete checkbox for the original item as long as an associated reduced price item is in the cart. (Based on the presence of a special "RecID" field I have set up in the cart to associate the original item's ID with the reduced price item.

The customer will be offered more than one reduced price item per Original Item.

The method I have set up so far that works for one reduced price item only in the cart is:

**********************
<td class="eC_FormItem">
<?php if (($eCart1->DisplayInfo("ID")) != ($eCart1->ConditionalTotal("RecID"))) { ?>

<input type="checkbox" value="<?php echo $eCart1->DisplayInfo("ID"); ?>" name="eCart1_Delete_<?php echo $eCart1->DisplayInfo("WAUID"); ?>" />
<?php } ?>
</td>
***********************
RecID is the field in the reduced price item Add To Cart Button that contains the ID of the original item, so the cart needs to be scanned to see if the RecID matching the original item ID is in the cart..

The customer can delete the original item if he deletes the reduced price item first, because then the delete checkbox will again be visible.

The above code works well but fails when an additional reduced price item is added, because $eCart1->ConditionalTotal("RecID") sums the RecID items in the cart.

Say the original item ID is 6, and each "reduced price item" added has a RecID value of 6.
If two "reduced price items" are added, the RecID sums to 12 and so fails.

So is there an eCart operator that can scan the RecID fields in the cart to find if a value exists without summing them.

I thought I might find something that works similarly to ($eCart1->InCart("6") == true) to enable finding a dynamic value in a cart field.

I hope I have explained this well enough.

I thank you in advance for your time.

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...