The information in this thread might be outdated
If the solution did not help, please, check our Help Portal or contact Ecwid Team.
 
 
Thread Tools Display Modes
  #1  
Old 09-01-2010, 04:17 PM
zmcqueary's Avatar
zmcqueary is offline
Member
 
Join Date: Apr 2010
Posts: 95
Default

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!
  #2  
Old 09-01-2010, 07:53 PM
Qetzal's Avatar
Qetzal Qetzal is offline
Ecwid Team
 
Join Date: Sep 2009
Posts: 10,847
Default

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".
__________________
Eugene K.
Ecwid Team

@ecwid | Facebook | Ecwid Knowledge Base
  #3  
Old 09-01-2010, 08:44 PM
zmcqueary's Avatar
zmcqueary zmcqueary is offline
Member
 
Join Date: Apr 2010
Posts: 95
Default

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!
  #4  
Old 09-28-2010, 12:23 AM
zmcqueary's Avatar
zmcqueary zmcqueary is offline
Member
 
Join Date: Apr 2010
Posts: 95
Default

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...
  #5  
Old 09-28-2010, 05:10 PM
Qetzal's Avatar
Qetzal Qetzal is offline
Ecwid Team
 
Join Date: Sep 2009
Posts: 10,847
Default

Quote:
Originally Posted by zmcqueary View Post
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.
__________________
Eugene K.
Ecwid Team

@ecwid | Facebook | Ecwid Knowledge Base
  #6  
Old 09-28-2010, 05:36 PM
zmcqueary's Avatar
zmcqueary zmcqueary is offline
Member
 
Join Date: Apr 2010
Posts: 95
Default

Yeah, thats what I figured....okay, to work then hahaha

Thanks, Eugene
  #7  
Old 10-01-2010, 04:12 PM
zmcqueary's Avatar
zmcqueary zmcqueary is offline
Member
 
Join Date: Apr 2010
Posts: 95
Default

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?
  #8  
Old 10-03-2010, 10:09 AM
Qetzal's Avatar
Qetzal Qetzal is offline
Ecwid Team
 
Join Date: Sep 2009
Posts: 10,847
Default

Just try the following link:

HTML Code:
<iframe src="#ecwid:mode=cart"></iframe>
__________________
Eugene K.
Ecwid Team

@ecwid | Facebook | Ecwid Knowledge Base
  #9  
Old 10-03-2010, 08:22 PM
zmcqueary's Avatar
zmcqueary zmcqueary is offline
Member
 
Join Date: Apr 2010
Posts: 95
Default

Ugh, I must've been doing something wrong..I finally got it! Thanks, dude, I'll let you know how it comes out
  #10  
Old 10-04-2010, 01:44 PM
zmcqueary's Avatar
zmcqueary zmcqueary is offline
Member
 
Join Date: Apr 2010
Posts: 95
Default

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
If the solution did not help, please, check our Help Portal or contact Ecwid Team.

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:34 PM.
Powered by vBulletin® Version 3.8.11. Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.