DragonflyCMS Projects > Storez > [done] Converting Order style to "Add to Cart" style > Community Forums > Phoenix Netology
Forum Index > eCommerce > Storez

[done] Converting Order style to "Add to Cart" style Reply to topic


I have a client who's asked if Storez can be configured to match the "Add to Cart" style which seems to be becoming more prevalent. By that I mean that the 'Order' button is labeled 'Add to Cart' instead and clicking it does NOT take you to the Cart, but leaves you still on the shopping page.

I couldn't see an option for this, so checked the code. In cart.php addtoCart() exits via a urlredirect to showCart. It seems that merely changing this to return to the originating screen should accomplish the desired effect.

One obvious issue is knowing where the originating screen is. In the absence of any DF function (that I can think of), I'm planning to add a(nother) hidden field with the URL, as items can be purchased from either a product or a store screen.

I just wondered if you see a problem with this approach? Or if you have attempted same in past? This is on an existing Storez on v9.3.6, but if if I pull this off, there's hope of a new Storez site, on v9.4.0.

Thanks in advance for your time!

Please enter your server specs in your user profile! 😢


Laughing the only thing that changes is the size of the circle.

Used to work that way and was removed because a couple of users felt it confused customers.

Donations & Audit for DragonflyCMS

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):


I guess it all depends on where you shop! Wink

But thanks for this, good to know that it won't break basic flow. I also hear the advice, so will leave old code in place commented out for when/if they ask me to change it back! Smile

Please enter your server specs in your user profile! 😢


Not so much where you shop - usually the type of shopper and how many purchases they are likely to make at the same time. Invariably this is one item which immediately defeats the whole purpose.

These days I just give them what they want, but as an option, so I don't have to change the bloody code back again. I've recently been through an exercise in ultimate stupidity where I have spent six months restoring, one by one, every bloody feature of a whole website I was told (despite my protests) to remove - go figure.

Donations & Audit for DragonflyCMS

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):


Phoenix wrote
... how many purchases they are likely to make at the same time.


Agreed! 1 client, 2 sites/stores: one as Add to Cart and 1 as Order - for just this reason.

Phoenix wrote
These days I just give them what they want, but as an option, so I don't have to change the bloody code back again.


I understand! Seen the length of the Pro_News Config screen recently? Rolling Eyes

But more and more recently I've found I can meet user requirements through specialised Pro_News templates! Really helps, as the base code (Pro_News) doesn't have to be retested each time. (All learnt through reading reDesign templates - php includes - and Storez templates - complex IF conditions!)

Please enter your server specs in your user profile! 😢


Hello,

I recently had the same subjet to think about. Here is what i did, quick and dirty but i seems to work.

First i enabled the block showing the cart contents.

Then I modified the "add to cart" button in the stores and product templates so that it calls a javascript function wich submits the respective form using ajax. After the ajax call finished i reload the current page.

I know it's not the best solution as it is now because there are 2 calls done, especially the first one from wich i do not display the result. If we have a parameter to submit to the "add to cart" call wich toggles the display of the cart page or display nothing the server and bandwidth load could be reduced.

The best way would be to return the content of the updated block content. Doing this we prevent the reload of the current page and just update the cart block content using javascript.

what do you think about this way ?

Please enter your server specs in your user profile! 😢

All times are Australia/Adelaide


Jump to: