Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

E-Commerce Modules /

Discuss about the various e-commerce modules available:
Ecommerce, SS Shop, SilverCart and SwipeStripe
Alternatively, have a look the shared mailinglist.

Moderators: martimiz, Nicolaas, Sean, Ed, frankmullenger, biapar, Willr, Ingo, Jedateach, swaiba

Shop module and AJAX


Go to End


6 Posts   2926 Views

Avatar
Josua

Community Member, 87 Posts

4 May 2012 at 10:43pm

Hi Jeremy!

I've seen lately that you've added some AJAX to the shop module.
Now the cart works with AJAX without refreshing the whole page?

Thanks,
Regards,

Jose

Avatar
Jedateach

Forum Moderator, 238 Posts

5 May 2012 at 10:13am

Edited: 05/05/2012 10:14am

Hi Josua,

I haven't added any functionality, I've only started disconnecting it from the model code - order, orderattributes, etc.
I'm currently just focusing on improving the core PHP code. If this is not done right first, then it will be difficult to maintain the ajax functionality.
I'm hoping that with my core changes, ajax updating carts will be simple to implement via some kind of json web service API. I also want the ajax functionality to be loosely coupled to the core, so it can be easily be removed or swapped for something else.

Is an AJAX updating cart a strong requirement for your current project(s)? What major benefit(s) do you see with an ajax cart?

regards,
Jeremy

Avatar
Josua

Community Member, 87 Posts

5 May 2012 at 11:28pm

Hi Jeremy!

In the shopping cart users are accustomed to adding a product to the cart be fast and the page not return to position in the top.
If you're located in the middle of a web page and every time you click on 'Add to Cart' the page is set at the beginning, the user has to reposition back where it was, which is quite annoying.
The modern shopping cart all have AJAX support in the cart.

The 10 basic requirements that need to the shopping cart are:
- Speed ​​(AJAX cart)
- Multicurrency.
- Variations on a product (description and different prices for each variation).
- Also recommended.
- Any price product (for services, donations and price adjustment).
- Taxes by country or region.
- Discount coupons.
- Special offer prices for a given product.
- Comments by product added to cart.
- Visually attractive and easy in your handling (Twitter Bootstrap theme).

Too many things. Right? :)

Regards,
Jose

Avatar
Jedateach

Forum Moderator, 238 Posts

18 May 2012 at 11:33am

Hi Jose, been a while. Thanks for this list, I've added links below to issues or implementations

- Speed ​​(AJAX cart)
https://github.com/burnbright/silverstripe-shop/issues/49
- Multicurrency.
https://github.com/burnbright/silverstripe-shop/issues/29
- Variations on a product (description and different prices for each variation).
fixed in next release
- Also recommended.
Not very hard to implement. Coming soon.
https://github.com/burnbright/silverstripe-shop/issues/50
- Any price product (for services, donations and price adjustment).
https://github.com/burnbright/silverstripe-shop/issues/41
- Taxes by country or region.
https://github.com/burnbright/silverstripe-shop/issues/51
- Discount coupons.
done.
https://github.com/burnbright/silverstripe-shop-discount
- Special offer prices for a given product.
https://github.com/burnbright/silverstripe-shop/issues/41
- Comments by product added to cart.
https://github.com/burnbright/silverstripe-shop/issues/52
- Visually attractive and easy in your handling (Twitter Bootstrap theme).
https://github.com/burnbright/silverstripe-bootstrap
https://github.com/burnbright/silverstripe-bootstrap-shop

thanks again
Jeremy

Avatar
Josua

Community Member, 87 Posts

19 May 2012 at 1:23am

Hi Jeremy,

Thank you very much for considering all these features.

One more thing I believe that it is not in the current version:
The customer data (name, address, city, country, etc.) must be saved along with the order, in order to be able to consult them at a later time, although the customer had modified his data recently.

In the AJAX implementation would be interesting to use a session to save all the data of the selected products and record in the database only when the purchase had taken effect.

Are you planning a timetable for implementing these features?
Do include them in version 1?
When do you think you will have the version 1?

Sorry so many questions. ;-)

Thanks,
Regards,
Jose

Avatar
Jedateach

Forum Moderator, 238 Posts

21 May 2012 at 11:50am

Edited: 21/05/2012 11:51am

"The customer data (name, address, city, country, etc.) must be saved along with the order, in order to be able to consult them at a later time, although the customer had modified his data recently."

Currently this is the case. The Order class saves all shipping and contact info. I'll be changing to using an external Address class for this data soon, but I'll still make sure the data isn't lost.

"would be interesting to use a session to save all the data of the selected products and record in the database only when the purchase had taken effect"

In early versions of the ecommerce module (which shop forks from), the cart was actually stored in the session. Whilst this didn't mean database records were created, it was very difficult to maintain. Moving everything to the database was a good move. A different approach might be to store carts in a different table like "Cart". Until this becomes a serious problem to need solving, and a good solution is worked out, I'll keep things the way they are.

"Are you planning a timetable"

I want to have most things finished off by version 1, which I've roughly planned for next year. I don't have a strict timeline. I can only devote as much time to this module as my client work sustains me, or what support the community provides.

Jeremy