The information in this thread might be outdated
|

02-01-2012, 06:43 PM
|
 |
Paid Member
|
|
Join Date: Jan 2012
Posts: 15
|
|
Same problems.
Js code insert latest order.
CSS theme adjusted according your message above.
But price still stay at place.
Here is my site
|

02-01-2012, 07:07 PM
|
 |
Junior Member
|
|
Join Date: Jan 2012
Posts: 13
|
|
Quote:
Originally Posted by Eugene Rimmer
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"));
|

02-02-2012, 10:28 AM
|
 |
Senior Member
|
|
Join Date: Jan 2011
Location: Ecwid headquarters
Posts: 7,765
|
|
Quote:
Originally Posted by Alex Tsodikov
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));
}
})
|

02-02-2012, 01:57 PM
|
 |
Junior Member
|
|
Join Date: Jan 2012
Posts: 13
|
|
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"));
|

02-02-2012, 03:36 PM
|
 |
Senior Member
|
|
Join Date: Jan 2011
Location: Ecwid headquarters
Posts: 7,765
|
|
Quote:
Originally Posted by Alex Tsodikov
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.
|

02-02-2012, 03:39 PM
|
 |
Junior Member
|
|
Join Date: Jan 2012
Posts: 13
|
|
Quote:
Originally Posted by Eugene Rimmer
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..
|

02-02-2012, 07:38 PM
|
 |
Paid Member
|
|
Join Date: Jan 2012
Posts: 15
|
|
Alex Tsodikov Please drop me a link to you site. Let me study it. I still have problems with my joomla site
|

02-02-2012, 07:51 PM
|
 |
Junior Member
|
|
Join Date: Jan 2012
Posts: 13
|
|
Quote:
Originally Posted by zapravka57
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.
|

02-02-2012, 08:08 PM
|
 |
Paid Member
|
|
Join Date: Jan 2012
Posts: 15
|
|
Alex Tsodikov Ok! And did You insert exactly same code in Ecwid CSS style as recommended above?
|

02-02-2012, 08:16 PM
|
 |
Junior Member
|
|
Join Date: Jan 2012
Posts: 13
|
|
Quote:
Originally Posted by zapravka57
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
|
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 06:30 AM.
Powered by vBulletin® Version 3.8.11. Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
|