close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Dynamically Changing Values in eCart Object

Thread began 11/08/2011 11:32 am by martin400112 | Last modified 11/09/2011 6:59 am by Jason Byrnes | 992 views | 1 replies |

martin400112

Dynamically Changing Values in eCart Object

Hi everyone,

My supermarket client is asking to be able to add specific discounts to either manufacturers product lines or specific products.

I can see how I, as her designer can add discounts on specific products or manufacturers and it looks fairly simple in eCart...

... However, if I wanted to enable my client to be able to specify which products/manufactures she discounts and by how much, how is it possible to do this dynamically in the cart page (called piccCart_PHP.php in this case)? Does it have to be done with session values, recordsets, or another way...?

Many thanks,

Martin

Sign in to reply to this post

Jason ByrnesWebAssist

It would need to be done using a database.

to get started with dynamic discount codes see this thread:
showpost.php?p=23007&postcount=2

to apply the discounts to a specific manufacturer, you would need to set up the products table to have a column for manufacturer, and set the eCart object to have a column for manufacturer as well, so that when a product is added to the cart, the manufacturer is added along with it.

Your discounts table would also need to have a column for the manufacturer. this column would need to be stored in a session variable so it could be used in the trigger for the coupon. For the sake of example, lets say the session is named "manufacturer"

to set the discount up, use the trigger "Number of items with a specific column value":
If the total number of items where "manufacturer" has a value of "$_SESSION['manufacturer']" is ">" a value of "0"

The calculation would depend on how the discount should be applied, but you would use the PromoAmount session variable


tying the discount to specific products is a little more difficult. do you want to be able to apply more than one discount to to a product? for example, should discount a be able to apply product a, c, d and discount b apply to product a, b, d. with product a and d being a member of both discounts, or will each product only be able to belong to one discount?

if each product can only apply to one discount, the you would need a discountID column in the products table. This column will store the discount associated to it.

you also need a discountID column in the cart Object and set the add to cart buttons to store this value in the cart.

when the lookup recordset is creating the session variables, store the couponID from the coupon table into another session.

from here the process is similar to manufacturers. use the "Number of items with a specific column value" trigger and use the couponID session for comparison.

Sign in to reply to this post

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...