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 07-30-2012, 09:48 PM
Redwood's Avatar
Redwood is offline
Member
 
Join Date: Oct 2010
Posts: 33
Arrow

Removing $0.00 from Product Detail Pages - Need assistance


Instructions were provided on how to do this in the following thread:
http://www.ecwid.com/forums/showthre...t=12096&page=3

I copied the javascript and pasted it as is below the widget that installs the ecwid cart. The $0.00 amount is still showing. I appreciate anyone's input on why the code may not be working.
  #2  
Old 07-31-2012, 12:25 PM
Maya's Avatar
Maya Maya is offline
Ecwid Team
 
Join Date: Feb 2010
Location: Ecwid headquarter
Posts: 5,876
Default

Could you give me the link, where Ecwid store is installed?
__________________
Maya N., Ecwid Team

------------------
Welcome to our new Help Center!
The Following User Says Thank You to Maya For This Useful Post:
Redwood (07-31-2012)
  #3  
Old 07-31-2012, 01:01 PM
Redwood's Avatar
Redwood Redwood is offline
Member
 
Join Date: Oct 2010
Posts: 33
Default

Thank you for responding Maya. Here is the link to the site.
  #4  
Old 07-31-2012, 01:57 PM
Maya's Avatar
Maya Maya is offline
Ecwid Team
 
Join Date: Feb 2010
Location: Ecwid headquarter
Posts: 5,876
Default

Quote:
Originally Posted by Redwood View Post
Thank you for responding Maya. Here is the link to the site.
I have checked your site and found out that script, which should hide zero prices has been inserted incorrectly. This thing is that "&" symbol has been changed to "&" for some reason.

Please, replace current script with this one:
Code:
(function() {
  var __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i <l; i++) { if (i in this && this[i] === item) return i; } return -1; };
  var categories;
  /* if you need to have the zero price generally visible in the store and hide them only in some categories, you can put those categories' IDs, comma separated, into categories array below */
  categories = [3204099, 3204100];
  /* like
 categories = [2222333, 44455555];
 */
  Ecwid.OnAPILoaded.add(function() {
    var zeroval;
    zeroval = Ecwid.formatCurrency(0);
    Ecwid.OnPageLoaded.add(function(page) {
      var $, _ref;
      $ = window.jQuery;
      if (page.type === 'PRODUCT' && ((_ref = page.categoryId, __indexOf.call(categories, _ref) >= 0) || categories.length === 0)) {
        $('div.ecwid-productBrowser-price:contains("'+zeroval+'")').css({
          display: 'none'
        });
      }
    });
  });
})();
and make sure that it has been saved correctly.

Once you insert this script properly, everything will work as expected.
__________________
Maya N., Ecwid Team

------------------
Welcome to our new Help Center!
The Following User Says Thank You to Maya For This Useful Post:
Redwood (07-31-2012)
  #5  
Old 07-31-2012, 03:42 PM
Redwood's Avatar
Redwood Redwood is offline
Member
 
Join Date: Oct 2010
Posts: 33
Default

Thank you kindly for responding Maya.

Regarding proper placement, I put it within <script> tags right below the Ecwid cart widget, yet it's still not working. Is there some other place it should reside?
  #6  
Old 08-01-2012, 07:42 AM
Maya's Avatar
Maya Maya is offline
Ecwid Team
 
Join Date: Feb 2010
Location: Ecwid headquarter
Posts: 5,876
Default

Quote:
Originally Posted by Redwood View Post
Thank you kindly for responding Maya.

Regarding proper placement, I put it within <script> tags right below the Ecwid cart widget, yet it's still not working. Is there some other place it should reside?
Most probably, you have placed this code in visual mode. Please, open the page, where Ecwid is installed, in WP Admin, switch your editor to the HTML mode (must-do) and insert the script from my previous message.

Once you do this, it will work as expected.
__________________
Maya N., Ecwid Team

------------------
Welcome to our new Help Center!
  #7  
Old 08-01-2012, 08:04 AM
Redwood's Avatar
Redwood Redwood is offline
Member
 
Join Date: Oct 2010
Posts: 33
Default

Hello Maya,
Code was not placed via visual mode. I only work in HTML mode. Had it been placed via visual mode, the Ecwid widget wouldn't have worked either
  #8  
Old 08-01-2012, 12:41 PM
Maya's Avatar
Maya Maya is offline
Ecwid Team
 
Join Date: Feb 2010
Location: Ecwid headquarter
Posts: 5,876
Default

Quote:
Originally Posted by Redwood View Post
Hello Maya,
Code was not placed via visual mode. I only work in HTML mode. Had it been placed via visual mode, the Ecwid widget wouldn't have worked either
I have checked your site and as far as I can see, it still has incorrect symbols inside it, and, as a result, it does not work properly.

I suggest you to place this script in external file, upload it on your server and use the direct link to this script on your site.

In order to do this you should:
1. Download attached file.
2. Rename it from "hide_zero.js.txt" to "hide_zero.js"
3. Upload this file on your server in one of folder with js-scripts (for example "/wp-includes/js/")
4. Put following code instead of current one on the source page, where Ecwid is installed:
Code:
<script type='text/javascript' src='http://yourwebsite.com/gih_site/wp-includes/js/hide_zero.js'></script>
where, "http://greatindianhair.com/gih_site/wp-includes/js/" is the absolute path to this script on your server.

Once you do this, script will work as expected. Please, try and let me know about results.
Attached Files
File Type: txt hide_zero.js.txt (918 Bytes, 44 views)
__________________
Maya N., Ecwid Team

------------------
Welcome to our new Help Center!

Last edited by Maya; 08-01-2012 at 01:14 PM.
  #9  
Old 08-01-2012, 01:07 PM
Redwood's Avatar
Redwood Redwood is offline
Member
 
Join Date: Oct 2010
Posts: 33
Default

Thank you Maya, I ended up using the solution you posted in the other thread. It worked perfectly.
 
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:29 PM.
Powered by vBulletin® Version 3.8.11. Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.