close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

add to cart problem

Thread began 7/07/2011 11:03 am by RRod55141879 | Last modified 7/07/2011 12:24 pm by Jason Byrnes | 1541 views | 3 replies |

RRod55141879

add to cart problem

Hi,

I am building a ecommerce website with framework builder and ecart.
Everything is working ok.
In the detail product i have add to cart button and works fine, in the list products also.

But in the homepage, i have one recordset that select books order by rand() and limit 0,5.
That recordset shows 5 books in a div with a add to cart button, but sometimes when i click in the button the results just disappear.

If i remove the "limit 0,5" in the recordset everything works fine.

Anyone have a answer for this?

Regards

Sign in to reply to this post

Jason ByrnesWebAssist

instead of setting the recordset to only return 5 records, set the repeat region to only show 5 records.


the rand() functions changes the order, the limit function limits the results to only 5 records.

these two together will cause the recordset to return different results each time, so the record for the item being added to the cart no longer exists.

Sign in to reply to this post

RRod55141879

Originally Said By: Jason Byrnes
  instead of setting the recordset to only return 5 records, set the repeat region to only show 5 records.


the rand() functions changes the order, the limit function limits the results to only 5 records.

these two together will cause the recordset to return different results each time, so the record for the item being added to the cart no longer exists.  


Hi Jason,

Thanks for your quick reply.

Ok, but i will not have problems of performance if the recordset retrieves 1000 rows?!
Usually i use limit int the sql statment because of performance concerns.

And your solution (that works) will not have a lot of rows to show, than the repeat reagion just show 5?

Waiting,

Regards

Sign in to reply to this post

Jason ByrnesWebAssist

sure, the recordset will be returning more rows than it needs to but there is not another to offer a random selection.
the work flow is this:

the reordset is created and the page displays the add to cart button to the user, code at the end of the page destroys the recordset result set.

the user clicks the add to cart button which posts a form

the page relaods, creates the recordset, triggers the code to add the item to the cart which looks at the ID passed in and tries to find that record in the recordset results.



By using ORDER BY rand() LIMIT 0, 5 the recordset result used to create the page at first will not be the same as the results set when the add to cart button posts.

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