The information in this thread might be outdated
|

09-01-2010, 04:17 PM
|
 |
Member
|
|
Join Date: Apr 2010
Posts: 95
|
|
Discount Rules - Possible API Customization?
Hello again!
This time, I may be spitballing but I would like to create a script that could grab the customer's total from the shopping cart, and show an alert such as, "Purchase $12.50 more and receive FREE Shipping!"
I don't believe these types of "discount rules" are in place currently, and I'm sure it has been requested in the Ideas forum, but is there a way to grab that information and use it to customize a simple script like this? Then again, I guess it would ALSO have to adjust the cost for a given shipping fee, still, it would be a good starting place if I am able to get that data.
Is this possible? If so, how might I go about getting that data?
Thanks!
|

09-01-2010, 07:53 PM
|
 |
Ecwid Team
|
|
Join Date: Sep 2009
Posts: 10,847
|
|
1. First of all, you can always create a discount coupon which will give free shipping for all orders over $100 or whatever.
2. Yes, it's possible to make such a script.
For example, it can check if the cart page is opened. And if it is, then it can get the value of "div.ecwid-productBrowser-cart-totalAmount".
|

09-01-2010, 08:44 PM
|
 |
Member
|
|
Join Date: Apr 2010
Posts: 95
|
|
OooooooOOooo...cool beans. Yeah, I noticed I actually can't create a discount coupon unless I have the membership..which isn't all that bad I know I would be eventually anyway, but there it is.
Awwww, sweet, I didn't even think to check it via css elements, very cheeky! Thanks for setting me in the right direction, Eugene!
|

09-28-2010, 12:23 AM
|
 |
Member
|
|
Join Date: Apr 2010
Posts: 95
|
|
Hey Eugene,
Sorry again...can you think of any way to grab the values if the cart page ISN'T open? Say, if I'm utilizing the bag widget or the browser window, the alert message cannot pull the bag total from the div if its all done on the same page.
So is there an action or function that I can utilize to throw this alert with the total...say, the 'Go to Checkout' button? I'm not sure...
|

09-28-2010, 05:10 PM
|
 |
Ecwid Team
|
|
Join Date: Sep 2009
Posts: 10,847
|
|
Quote:
Originally Posted by zmcqueary
Hey Eugene,
Sorry again...can you think of any way to grab the values if the cart page ISN'T open? Say, if I'm utilizing the bag widget or the browser window, the alert message cannot pull the bag total from the div if its all done on the same page.
So is there an action or function that I can utilize to throw this alert with the total...say, the 'Go to Checkout' button? I'm not sure... 
|
Unfortunately, no easy way to do this.
However, please try the following workaround: you can dynamically create a hidden iframe with a page from the _same domain_. This page should contain the Ecwid code and open the cart page by default. Your JavaScript will have access to this iframe`s code and order total.
|

09-28-2010, 05:36 PM
|
 |
Member
|
|
Join Date: Apr 2010
Posts: 95
|
|
Yeah, thats what I figured....okay, to work then hahaha
Thanks, Eugene
|

10-01-2010, 04:12 PM
|
 |
Member
|
|
Join Date: Apr 2010
Posts: 95
|
|
Ugh, ok, Eugene...don't kill me.
I'm trying to setup the link through the iframe as suggested, and am testing the link to the bag/cart page to use the code for the div containing the total.
I know it can be managed by the url using: #ecwid:mode=cart
But I can't seem to get it set correctly. I've tried using <?php bloginfo('template_directory'); ?>#ecwid:mode=cart (wordpress php snippet), but it doesn't seem to work when I test it with a simple link.
What am I doing wrong?
|

10-03-2010, 10:09 AM
|
 |
Ecwid Team
|
|
Join Date: Sep 2009
Posts: 10,847
|
|
Just try the following link:
HTML Code:
<iframe src="#ecwid:mode=cart"></iframe>
|

10-03-2010, 08:22 PM
|
 |
Member
|
|
Join Date: Apr 2010
Posts: 95
|
|
Ugh, I must've been doing something wrong..I finally got it! Thanks, dude, I'll let you know how it comes out
|

10-04-2010, 01:44 PM
|
 |
Member
|
|
Join Date: Apr 2010
Posts: 95
|
|
Ok, so no matter which I use, '<?php the_permalink() ?>#ecwid:mode=cart' or '#ecwid:mode=cart', I get a null. When I display it, I get a blank box. The link in my source code gives the correct format and everything though. Does it have something to do with where the script is located on the page?
|
The information in this thread might be outdated
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT. The time now is 11:02 AM.
Powered by vBulletin® Version 3.8.11. Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
|