We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Mark Bowen Shopping Cart Plug-in

Development and Programming

optima's avatar
optima
121 posts
16 years ago
optima's avatar optima
When you visit the template with the empty cart plugin code in it what happens exactly?

I am redirected to the desired template, in this instance back to the cart which remains full.

Also what have you used as the name of your shopping cart? I’m wondering if that might be it perhaps? Might be worth changing the name of the cart to something else in all your templates.

When you say the name of my shopping cart, do you mean the name of the weblog that holds all my products? In which case it’s short name is “products”.

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen
When you say the name of my shopping cart, do you mean the name of the weblog that holds all my products? In which case it’s short name is “products”.

Sorry no I meant when you use the add plugin code to add an item you have a cart_name=”“ parameter in the code. What do you have that set to?

Once I have that then I will test out the plugin on a new install of 1.6.8 and see if I can reproduce. If not then I would suggest re-typing in the plugin codes as it may well just be a curly quote that has crept in there somewhere.

As mentioned before though the plugin was written to work with ExpressionEngine up to 1.6.7 and so it has never been tested on 1.6.8

Best wishes,

Mark

       
optima's avatar
optima
121 posts
16 years ago
optima's avatar optima
Sorry no I meant when you use the add plugin code to add an item you have a cart_name=”“ parameter in the code. What do you have that set to?

Well it was “products”, but now I have changed it to a more suitable semantic name – “dave” – and still no luck.

I take it that the empty cart plugin code doesn’t require the cart_name parameter as per the documentation. Tried with and without anyway with no avail.

Definitely no curly quotes, done a find and replace.

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen
Well it was “products”, but now I have changed it to a more suitable semantic name – “dave” – and still no luck. I take it that the empty cart plugin code doesn’t require the cart_name parameter as per the documentation. Tried with and without anyway with no avail.

Aha I see what is happening. Just tried it out myself and I can see where my mistake lies 😉

If you change the cart_name parameter to cart_name=”shop” instead of dave for a while (this will lose any items you previously added to your cart so you will need to add some more) then it should all start working again.

The problem lies in that I only ever meant for this plugin to be used for one cart on a site and not multiple carts however I do think you should be able to do that too. Saying that though unless the cart_name=”“ parameter goes into the empty cart code as you mentioned above then at the moment it is trying to delete the cart called shop (currently hard-coded into the plugin) so won’t delete any other carts unless you call them shop.

For now whilst you are testing could you use the cart_name of shop instead of dave and I will code up a new version of the plugin so that the empty cart code has that parameter to enable you to call your cart whatever you want.

Sorry about the confusion there.

Will get a new plugin over to you as soon as possible. Actually to that end could you send me your e-mail address as I believe you purchased this through eetemplates.com so I won’t have that information but if you can send it over to me then I will get the fixed version over to you as soon as possible.

Best wishes,

Mark

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen

Actually just to let you know that I now have the fix in place so if you can send me your e-mail address then I will get the fixed version over to you immediately.

This means that you can now call your cart_name whatever you like and in the empty cart plugin template code you can now do this :

{exp:shopping_cart_functions:empty_shopping_cart cart_name="dave" redirect="cart/view" referring_page="yes"}

Best wishes,

Mark

       
awsadmin's avatar
awsadmin
127 posts
16 years ago
awsadmin's avatar awsadmin

I was reading through the entire thread and didn’t see my question asked. I have multiple users in my site. Can I create a shopping cart for each member to only show their own products? I would create one shopping cart per template group. Is there an admin where that user can log in and see their orders, separate from another user who logs in and sees their products and orders as well?

       
optima's avatar
optima
121 posts
16 years ago
optima's avatar optima

Hi Mark

The updated version works beautifully, many thanks for the update.

Another one for you… why do both {sub_total} and {total} output without two decimal places (£10 or £9.8) unlike {item_regular_price} which outputs as expected (£10.00 or £9.80)?

Best Regards

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen
Hi Mark The updated version works beautifully, many thanks for the update. Another one for you… why do both {sub_total} and {total} output without two decimal places (£10 or £9.8) unlike {item_regular_price} which outputs as expected (£10.00 or £9.80)? Best Regards

You’re just going to keep on finding more work for me aren’t you 😉

Yep I did actually know about this and myself (when this has cropped up), I have used the Number Format plugin to get around this. I will however put this on my to do list to find out why that is happening and fix it up in a new version for you.

I’m not around for the next few days however so this will go on my to do list for some time late next week if that’s okay.

Best wishes,

Mark

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen

Hiya,

Sorry almost missed this post.

I was reading through the entire thread and didn’t see my question asked. I have multiple users in my site. Can I create a shopping cart for each member to only show their own products? I would create one shopping cart per template group. Is there an admin where that user can log in and see their orders, separate from another user who logs in and sees their products and orders as well?

The plugin is not actually intended for this kind of thing. It is intended to create a shopping cart which will store items that a user would like to purchase and hold them in the cart until they are ready to checkout.

Saying that though if you use this or even just the standard Simple Commerce Tag code along with PayPal then once a user (they will need to be a registered user first before checking out for this to work) has purchased an item(s) then PayPal sends back a call to your site and adds that purchase to the database. You can then use a SQL query to bring back all the items that just that user purchased or you can use another plugin that I wrote (that one is also a commercial product now) which would allow you to very easily show the entries / items they purchased.

Hope that helps a bit.

Best wishes,

Mark

       
optima's avatar
optima
121 posts
16 years ago
optima's avatar optima

Sorry about that, lol. That’ll be absolutely fine.

Also, I spotted a few little errors in cart-contents code in the documentation, but I’ll PM you with those, if you want that is?

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen
Sorry about that, lol. That’ll be absolutely fine. Also, I spotted a few little errors in cart-contents code in the documentation, but I’ll PM you with those, if you want that is?

Would they be the fact that the code has split onto a new line and for some reason placed a space in-between some of the URL links 😉

That I know about and I have been meaning to re-write the whole of the documentation. I’m probably also just going to send out .rtf files with the template codes in them instead of in the PDF as that seems to be causing quite a few headaches.

If not that then I’d be interested to hear what you’ve found as I just copied and pasted all the codes yesterday to test something out on this and apart from the line-break / space issue I didn’t come across anything else.

Best wishes,

Mark

       
optima's avatar
optima
121 posts
16 years ago
optima's avatar optima

The remove link in the cart-contents code is as follows

{path="cart/remove{entry_id}/previous"}

should it not be

{path="cart/remove/{entry_id}"}

the forward slash missing before {entry_id} being the main issue.

Also, the alt tags for your decrease and increase images are both “Remove Item”

Finally, I found it necessary to add the following to the checkout form

<input type="hidden" name="return" value="{site_url}basket/success/" />
<input type="hidden" name="cancel_return" value="{site_url}shop/" />
       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen
The remove link in the cart-contents code is as follows
{path="cart/remove{entry_id}/previous"}
should it not be
{path="cart/remove/{entry_id}"}
the forward slash missing before {entry_id} being the main issue. Also, the alt tags for your decrease and increase images are both “Remove Item” Finally, I found it necessary to add the following to the checkout form
<input type="hidden" name="return" value="{site_url}basket/success/" />
<input type="hidden" name="cancel_return" value="{site_url}shop/" />

Hmm I guess you must have a quite old version of the documentation as mine doesn’t have any of those problems. I will shoot the latest version over to you on PM after I’ve written this.

As to the checkout code that’s just in there as an example as there are many different ways that could be coded but thanks for showing everyone that as I’m sure it may help others out at some point.

Will PM that file to you now 😊

Best wishes,

Mark

       
Richard Frank's avatar
Richard Frank
200 posts
16 years ago
Richard Frank's avatar Richard Frank

Hi all

Ok, I need to create a shopping cart that can take the following products:

  • 1-day events (no problem; create them as products; set quantity of online tickets available)
  • normal retail merchandise
  • Hotel accommodation bookings (will set quantity of rooms available per day and run each day as a product; person can select each day and add to shopping cart; but I need a drop down for single vs. two people sharing and the price to change (product customisation options))

Any ideas on how to go about this?

Thanks, Richard

       
optima's avatar
optima
121 posts
16 years ago
optima's avatar optima
Hmm I guess you must have a quite old version of the documentation as mine doesn’t have any of those problems. I will shoot the latest version over to you on PM after I’ve written this.

I did only buy and download this from EE Templates last week and that’s how the code was in the instructions.pdf in the docs folder.

       
First 4 5 6 7 8 Last

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.