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
  #21  
Old 02-01-2012, 06:43 PM
zapravka57's Avatar
zapravka57 is offline
 
Join Date: Jan 2012
Posts: 15
Default


Same problems.
Js code insert latest order.

CSS theme adjusted according your message above.
But price still stay at place.
Here is my site
  #22  
Old 02-01-2012, 07:07 PM
Alex Tsodikov's Avatar
Alex Tsodikov Alex Tsodikov is offline
Junior Member
 
Join Date: Jan 2012
Posts: 13
Default

Quote:
Originally Posted by Eugene Rimmer View Post
I am very sorry, but the code suggested for you was incorrect. Here is the cleaner version of the same code that should work:
Code:
Ecwid.OnPageLoad.add(function(page) {
  if (page.type == "PRODUCT") { /* define that product detailed page is loaded */
    $(".ecwid").toggleClass("hide-price-n-button", (page.categoryId.toString() == "ID_WITH_HIDDEN_PRICE")); /* add/remove class for container where price and button should be hidden */
  }          
})
Thanks, it seems to be working on my site, however, I need to hide it on a few categories.
I tried listing them one after another but it did not work. It does work then only one category is listed. It is possible to list all categories in in the array? Thank you for your help.

$(".ecwid").toggleClass("hide-price-n-button", (page.categoryId.toString() == "2074201"));
$(".ecwid").toggleClass("hide-price-n-button", (page.categoryId.toString() == "2061042"));
$(".ecwid").toggleClass("hide-price-n-button", (page.categoryId.toString() == "2074183"));
$(".ecwid").toggleClass("hide-price-n-button", (page.categoryId.toString() == "2074194"));
$(".ecwid").toggleClass("hide-price-n-button", (page.categoryId.toString() == "2057085"));
$(".ecwid").toggleClass("hide-price-n-button", (page.categoryId.toString() == "2061036"));
  #23  
Old 02-02-2012, 10:28 AM
Eugene Rimmer's Avatar
Eugene Rimmer Eugene Rimmer is offline
Senior Member
 
Join Date: Jan 2011
Location: Ecwid headquarters
Posts: 7,765
Default

Quote:
Originally Posted by Alex Tsodikov View Post
Thanks, it seems to be working on my site, however, I need to hide it on a few categories.
I tried listing them one after another but it did not work. It does work then only one category is listed. It is possible to list all categories in in the array? Thank you for your help.

$(".ecwid").toggleClass("hide-price-n-button", (page.categoryId.toString() == "2074201"));
$(".ecwid").toggleClass("hide-price-n-button", (page.categoryId.toString() == "2061042"));
$(".ecwid").toggleClass("hide-price-n-button", (page.categoryId.toString() == "2074183"));
$(".ecwid").toggleClass("hide-price-n-button", (page.categoryId.toString() == "2074194"));
$(".ecwid").toggleClass("hide-price-n-button", (page.categoryId.toString() == "2057085"));
$(".ecwid").toggleClass("hide-price-n-button", (page.categoryId.toString() == "2061036"));
Yes, you can keep the categories in the array structure, but you will need to change the script to this:

Code:
Ecwid.OnPageLoad.add(function(page) {
  if (page.type == "PRODUCT") { /* define that product detailed page is loaded */
    var categories,
      __indexOf = Array.prototype.indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };

    categories = ["2074201", "2061042", "2074183", "2074194", "2057085", "2061036"];
    $(".ecwid").toggleClass("hide-price-n-button", (__indexOf.call(categories, page.categoryId.toString()) >= 0));
  }          
})
  #24  
Old 02-02-2012, 01:57 PM
Alex Tsodikov's Avatar
Alex Tsodikov Alex Tsodikov is offline
Junior Member
 
Join Date: Jan 2012
Posts: 13
Default

hmm, does not seem to be working.
Is listing them one by one should work as well? I appreciate your help.

$(".ecwid").toggleClass("hide-price-n-button", (page.categoryId.toString() == "2074201"));
$(".ecwid").toggleClass("hide-price-n-button", (page.categoryId.toString() == "2061042"));
$(".ecwid").toggleClass("hide-price-n-button", (page.categoryId.toString() == "2074183"));
$(".ecwid").toggleClass("hide-price-n-button", (page.categoryId.toString() == "2074194"));
$(".ecwid").toggleClass("hide-price-n-button", (page.categoryId.toString() == "2057085"));
$(".ecwid").toggleClass("hide-price-n-button", (page.categoryId.toString() == "2061036"));
  #25  
Old 02-02-2012, 03:36 PM
Eugene Rimmer's Avatar
Eugene Rimmer Eugene Rimmer is offline
Senior Member
 
Join Date: Jan 2011
Location: Ecwid headquarters
Posts: 7,765
Default

Quote:
Originally Posted by Alex Tsodikov View Post
hmm, does not seem to be working.
Is listing them one by one should work as well? I appreciate your help.

$(".ecwid").toggleClass("hide-price-n-button", (page.categoryId.toString() == "2074201"));
$(".ecwid").toggleClass("hide-price-n-button", (page.categoryId.toString() == "2061042"));
$(".ecwid").toggleClass("hide-price-n-button", (page.categoryId.toString() == "2074183"));
$(".ecwid").toggleClass("hide-price-n-button", (page.categoryId.toString() == "2074194"));
$(".ecwid").toggleClass("hide-price-n-button", (page.categoryId.toString() == "2057085"));
$(".ecwid").toggleClass("hide-price-n-button", (page.categoryId.toString() == "2061036"));
Sorry, but as far as I can see, the script does work. It should hide the price on the product details page for the products in categories ##2074206, 2039914, 2061049.

So, here are such products:
http://#ecwid:category=2074206&mode=...roduct=9034385
http://#ecwid:category=2039914&mode=...roduct=8691375
http://#ecwid:category=2061049&mode=...roduct=9164270

None of them has a price displayed.

If you mean removing prices from category listings, this was initially done with CSS, not the script.

Last edited by Eugene Rimmer; 02-02-2012 at 03:49 PM.
  #26  
Old 02-02-2012, 03:39 PM
Alex Tsodikov's Avatar
Alex Tsodikov Alex Tsodikov is offline
Junior Member
 
Join Date: Jan 2012
Posts: 13
Default

Quote:
Originally Posted by Eugene Rimmer View Post
Sorry, but as far as I can see, the script does work. It should hide the price on the product details page for the products in categories ##2074206, 2039914, 2061049.


None of them has a price displayed.

If you mean removing prices from category listings, this was initially done with CSS, not the script.

Thank you. I just fixed it by pasting the code directly into the footer.php.
For some reason, it did not work when it was pasted in wordpress text editor(source mode)
I really appreciate your help and assistance..
  #27  
Old 02-02-2012, 07:38 PM
zapravka57's Avatar
zapravka57 zapravka57 is offline
 
Join Date: Jan 2012
Posts: 15
Default

Alex Tsodikov Please drop me a link to you site. Let me study it. I still have problems with my joomla site
  #28  
Old 02-02-2012, 07:51 PM
Alex Tsodikov's Avatar
Alex Tsodikov Alex Tsodikov is offline
Junior Member
 
Join Date: Jan 2012
Posts: 13
Default

Quote:
Originally Posted by zapravka57 View Post
Alex Tsodikov Please drop me a link to you site. Let me study it. I still have problems with my joomla site
Just sent you PM. Let me know if you need any help. I would insert javascript directly into the php file.
I would not use any joomla built in text editor to insert javascript code.
  #29  
Old 02-02-2012, 08:08 PM
zapravka57's Avatar
zapravka57 zapravka57 is offline
 
Join Date: Jan 2012
Posts: 15
Default

Alex Tsodikov Ok! And did You insert exactly same code in Ecwid CSS style as recommended above?
  #30  
Old 02-02-2012, 08:16 PM
Alex Tsodikov's Avatar
Alex Tsodikov Alex Tsodikov is offline
Junior Member
 
Join Date: Jan 2012
Posts: 13
Default

Quote:
Originally Posted by zapravka57 View Post
Alex Tsodikov Ok! And did You insert exactly same code in Ecwid CSS style as recommended above?
Yes.
 
The information in this thread might be outdated
If the solution did not help, please, check our Help Portal or contact Ecwid Team.

Tags
remove price

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 04:34 AM.
Powered by vBulletin® Version 3.8.11. Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.