The information in this thread might be outdated
If the solution did not help, please, check our Help Portal or contact Ecwid Team.
Closed Thread
 
Thread Tools Display Modes
  #11  
Old 08-29-2012, 03:44 PM
Eugene Rimmer's Avatar
Eugene Rimmer is offline
Senior Member
 
Join Date: Jan 2011
Location: Ecwid headquarters
Posts: 7,765
Default


Quote:
Originally Posted by Moviskin View Post
Hi Eugene,

I've been getting some strange results when manipulating the page.type === "CART" page with jQuery inside the Javascript API (Ecwid.OnPageLoaded):

When the CART page was displayed, part of the jQuery code seemed not to have worked but when I tested the whole jQuery code within the Firebug-console everything worked ok.

I was just about going nuts when during another test, I saw a glimpse of the CART-page just like I wanted it to be but the next second some already manipulated parts of the page were overwritten again e.g. the original link to the product in the product name.

It just seems that despite of using Ecwid.OnPageLoaded, the page has not been loaded completely?!

Eugene, what do you make out of this?

Thanks and regards,
Roland
1. What is your code?
2. Where can I see it in action?
3. What do you expect it to do?
__________________
Eugene Efimochkin, Team
_________________________
Shipping methods are not showing up? Here is how to set it up properly!
Have a question? Look up the answer at our help portal!

⬇ Click Thanks, please, if this reply helped you.
  #12  
Old 09-04-2012, 08:07 PM
Moviskin's Avatar
Moviskin Moviskin is offline
Junior Member
 
Join Date: May 2011
Posts: 13
Default

Hi Eugene,

I'm sorry for answering late because I hadn't seen your email notification.

I've been quite successful in my efforts to manipulate the CART-page with jQuery but it seems impossible to maintain the modified product name links because whenever I change the value in any Qty box in the pop-up cart page, the original <div> and its html appears again.

The original productname divs look like this:
Code:
<div class="ecwid-productBrowser-productNameLink"><a onclick="javascript: return false;" href="#ecwid:mode=product&amp;product=13884818">Moviskin</a></div>
With jQuery, I changed this div to:
Code:
<span class="ecwid-productNameLink"><a href="index.php/disena-tu-mismo/tu-moviskin?designId=330">Moviskin</a></span>
And this does work fine until I manually change the value in the Qty-box and the original code is restored again but without any CART-page event being fired thus leaving me without options to manipulate the links once again by for example detecting the event and refreshing the page.

Is this behaviour correct and if yes, is there any way to prevent or detect it?

Thanks a lot for your help Eugene.

Kind regards,
Roland
  #13  
Old 12-07-2013, 09:27 PM
jonesaj5's Avatar
jonesaj5 jonesaj5 is offline
Member
 
Join Date: Mar 2012
Posts: 39
Default Problems getting Javascript API working

Hi Everyone

i am also having problems getting some javascript API to work. I think it is possibly my javascript (still learning) and am wondering if you could look this over and give me some suggestions.

i am looking to write the number of ordered products alongside a shopping cart image with the following code. Basically when I run this code nothing is written even when I know there are products added to the cart.

javascript in the <head>
<script>
function loadImage()
{

Ecwid.Cart.get(function(cart) {
alert(cart.productsQuantity);
}
};
</script>

HTML and javascript in the <body>
<img src="img/basket6.jpeg" onload="loadImage()">


Thanks
Andy Jones
  #14  
Old 12-11-2013, 03:39 PM
Matt Ecwid's Avatar
Matt Ecwid Matt Ecwid is offline
Ecwid Team
 
Join Date: Oct 2011
Posts: 4,946
Default

Quote:
Originally Posted by jonesaj5 View Post
Hi Everyone

i am also having problems getting some javascript API to work. I think it is possibly my javascript (still learning) and am wondering if you could look this over and give me some suggestions.

i am looking to write the number of ordered products alongside a shopping cart image with the following code. Basically when I run this code nothing is written even when I know there are products added to the cart.

javascript in the <head>
<script>
function loadImage()
{

Ecwid.Cart.get(function(cart) {
alert(cart.productsQuantity);
}
};
</script>

HTML and javascript in the <body>
<img src="img/basket6.jpeg" onload="loadImage()">


Thanks
Andy Jones
Hi,

It would be much easier to say why it doesn't work if you provide a link to the page where it's installed. You can create one on http://jsfiddle.net and provide its URL. Thank you.

One assumption at the moment: a code that uses Ecwid JS API must be called when Ecwid object and Ecwid API are loaded. So, it's better to:
- put such code after Ecwid widgets integration codes in the body element
- use OnAPILoaded extension point to make sure API has been loaded by the moment your script start executing
__________________
Matt K
Ecwid Team

Ecwid Guide for Beginners

Ecwid Help Center

Ecwid video tutorials
  #15  
Old 10-09-2014, 12:54 PM
Pikius's Avatar
Pikius Pikius is offline
Junior Member
 
Join Date: Sep 2014
Posts: 4
Default

Hi, I'm new to javascript, sorry if this is not a plece for my question, but...
I need to do some price calculation which is required by the law in my country.
At this time ecwid displays price in one currency, what I need is to display it in two (e.g 10Lt/2.89€). Can I do this by using JavaScript API? If so how do I do this?
Thanks
  #16  
Old 10-10-2014, 06:55 AM
Rick G's Avatar
Rick G Rick G is offline
Ecwid Team
 
Join Date: Jun 2014
Posts: 1,270
Default

Quote:
Originally Posted by Pikius View Post
Hi, I'm new to javascript, sorry if this is not a plece for my question, but...
I need to do some price calculation which is required by the law in my country.
At this time ecwid displays price in one currency, what I need is to display it in two (e.g 10Lt/2.89€). Can I do this by using JavaScript API? If so how do I do this?
Thanks
Hi,

The prices for products are set up in on place - in the price block in Ecwid control panel > Catalog > Product.
Additionally you can create a new attribute in Ecwid control panel > Catalog > Product types. Then you can name it "local price" or something like that and give it a value of the price that you need.

Alternatively, in order to show prices in two values in the same price block on product details page you can use the Dynamic converter tool, developed by a 3rd party developer.

After you add this tool to your website, the prices will be displayed like this: http://take.ms/GpMJM

You can get the instructions from this page:
http://dynamicconverter.com/ecwid

Please mind that this tool was developed by a 3rd party developer, so I am not able to guarantee stable work of this tool.

You can find more info about product types and attributes in this article: http://help.ecwid.com/customer/porta...and-attributes
Thank you.
__________________
Ecwid API and App Market Team
Ecwid Developer Website

Last edited by Vitaliy G; 10-10-2014 at 06:58 AM.
  #17  
Old 10-10-2014, 10:12 AM
Pikius's Avatar
Pikius Pikius is offline
Junior Member
 
Join Date: Sep 2014
Posts: 4
Default

Hi,
thanks for quick reply. Those boys are greedy... I invested some of my time and coded my JS script to do the same and more suited to my needs. Much cheaper
Thanks anyway. Cheers!
Closed Thread
The information in this thread might be outdated
If the solution did not help, please, check our Help Portal or contact Ecwid Team.

Tags
html editor, jquery

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 03:32 PM.
Powered by vBulletin® Version 3.8.11. Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.