Forums / All Other Contributions/Addons / MAP Pricing v1.5 - display strike-through on MAP Price?

MAP Pricing v1.5 - display strike-through on MAP Price?

Views: 3,000

Results 1 to 20 of 21
11 Feb 2013, 4:40 AM
#1
johnnycopilot avatar

johnnycopilot

Zen Follower

Join Date:
Mar 2012
Posts:
325
Plugin Contributions:
0

MAP Pricing v1.5 - display strike-through on MAP Price?

I have Zen Cart V1.5 .. When I have MAP Price enabled, and the MAP price is displayed, now it says " $229 for SALE price, add to cart ".. I want to have a strike-through on the displayed price (only on MAP displayed price). Can I do this by adding some syntax to my CSS stylesheet? If so, where would I add it, and what would it be? I found this 'generic' syntax (below)for something else and so I thought I could make the displayed price on my site have a line through the displayed map price by doing something similar. If not, how can it be done? I am using abagon template. Website is https://www.stageandtheaterlighting.com Any help would be appreciated. Thanks!!! :)

.price .sale .onSale {
text-decoration: line-through;
color: #900;
}

11 Feb 2013, 6:33 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: MAP Pricing v1.5 - display strike-through on MAP Price?

A direct link to a page where this can be seen

Zen-Venom Get Bitten

11 Feb 2013, 6:44 AM
#3
johnnycopilot avatar

johnnycopilot

Zen Follower

Join Date:
Mar 2012
Posts:
325
Plugin Contributions:
0

Re: MAP Pricing v1.5 - display strike-through on MAP Price?

Kobra thanks. Here is a link. If you need to see more, all of the Omnisistem (brand) products are MAP. The dealers link is on the right. I either have the Omnisistem products listed as a specials, or they are MAP. There are also lots of new products just added that are MAP.
https://www.stageandtheaterlighting.com/index.php?main_page=product_info&cPath=10_12&products_id=1534 .. If you are talking about that little piece of syntax, I saw that here http://siteignition.com/Best+Practices/Add+Slash+Through+Price+for+Sale+Price

11 Feb 2013, 10:41 AM
#4
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: MAP Pricing v1.5 - display strike-through on MAP Price?

Is this an upgraded site??

On this page I see this probably owing to a collation mis match
https: // www. stageandtheaterlighting.com/index.php?main_page=product_info&cPath=11_19&products_id=392

• CORE:
• ABS molded plastic

• UNIT WEIGHT:
• 3 Lbs
• SHIPPING WEIGHT:
• 4 Lbs
• SHIPPING DIMENSIONS:
• 27In x 18In x 19In (12 per box)
Also, what you want will require custom code added to the MAP module
Stated in the module
a) should this product have MAP pricing enabled? If MAP pricing is enabled for that product, it replaces the price (throughout your website) with editable text that says: "Priced so low, we're not able to advertise it. Add to cart for price."
b) should a MAP price be displayed? If you specify a "Minimum Advertised Price" then it will say "$xxx.xx For a better price, add to your cart" (replacing $xxx.xx with the price you enter)
Also, why are you running your store front in https??

Zen-Venom Get Bitten

12 Feb 2013, 3:28 AM
#5
johnnycopilot avatar

johnnycopilot

Zen Follower

Join Date:
Mar 2012
Posts:
325
Plugin Contributions:
0

Re: MAP Pricing v1.5 - display strike-through on MAP Price?

kobra:

Is this an upgraded site??
I am not sure what you mean by upgraded site. I am using abagon template, and I tried to make some changes to the appearance of it. I am (kind of) familiar with the way that PHP works, but I literally don't know how to write any php code, so I did what I did from asking questions in the forum. Adding things to CSS, etc. but honestly, before I started learning to use the forum, there is no telling what I may have done to that template. Well, Actually I believe that I made notes... somewhere.

kobra:

On this page I see this probably owing to a collation mis match
https: // www. stageandtheaterlighting.com/index.php?main_page=product_info&cPath=11_19&products_id=392
1st, what do you mean by a collation mis match? Yea, that happened when I exported via apsona shopadmin to .csv file, and then re-uploaded; Around 400-500 products did that. I didn't see it until it was too late, and had to go back and change all of my descriptions one by one, because the only 'copy' I had of the descriptions in one place was in that corrupt export. Unfortunately I have not "fixed" them all yet. Those [ • ] characters used to be bullets, but somehow got transformed by Elvis. Now, when making product edits via apsona shopadmin, I don't export the "description" field and everything is fine. It could have happened when I pasted formatted code directly into my product description field {like copy/paste from word} (this is my first Zen site,, I have learned not to do that anymore), then exported, and re-imported, but not sure. I will figure out what happened later, but I do know for SURE it happened in the export, and i didn't see it until I had no 'good' database left (by database I mean product descriptions). Now my only recourse is to manually re-enter the descriptions that are corrupt. I haven't fixed them all yet.

kobra:

Also, what you want will require custom code added to the MAP module
Stated in the module
Kobra, in reference to.... > kobra:

a) should this product have MAP pricing enabled? If MAP pricing is enabled for that product, it replaces the price (throughout your website) with editable text that says: "Priced so low, we're not able to advertise it. Add to cart for price."
b) should a MAP price be displayed? If you specify a "Minimum Advertised Price" then it will say "$xxx.xx For a better price, add to your cart" (replacing $xxx.xx with the price you enter)
I see those two sentences in the 'readme.txt' file in the MAP Pricing v1.5 installation folder, but what am I supposed to do with that information? Where do I add the code, and what should the code say?

kobra:

Also, why are you running your store front in https??
I don't know, I have often wondered that myself. I know that I added the https url to a php page when I started taking credit cards, and some people said to put that https url in two places. ( I would have to go back and look at my old posts to find out who, and why I was told that, or perhaps I misunderstood someone). I saw where I was supposed to only put the https in one place at some point (in the php file), but honestly I just don't remember. I thought it was a security thing, but on the other hand, I thought that I only needed a secure page on the checkout page, or at least the part of the checkout that takes CC information. Is that hurting my SEO? Do you mind providing a link for me to fix it the correct way please? Thanks Kobra !!!!!!!!!!!

One more thing. I DO want the map price to show, but I just want a thin line through it, so the customer can see what the price 'was' before new price shows up in cart..

12 Feb 2013, 3:56 AM
#6
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: MAP Pricing v1.5 - display strike-through on MAP Price?

In this section output by tpl_product_info_display.php ```html

<!--bof Product Price block --> <h2 id="productPrices" class="productGeneral"> <span class="map_pricing">$398 for SALE price, add to cart</span></h2> ``` the entire span is one block so the price cannot be styled separately. The PHP code will have the price output followed by (probably) a constant which holds the text " for SALE price, add to cart". You may be able to find the define for that constant and add new <span> tags around that part like this```php define('MAP_TEXT_WHATEVER_NAME', '<span class="noMap"> for SALE price, add to cart</span>'); ``` In your stylesheet``` .map_pricing {text-decoration: strikethrough;} .map_pricing .noMap {text-decoration: none;} ```
12 Feb 2013, 4:25 AM
#7
johnnycopilot avatar

johnnycopilot

Zen Follower

Join Date:
Mar 2012
Posts:
325
Plugin Contributions:
0

Re: MAP Pricing v1.5 - display strike-through on MAP Price?

Thanks gjh42, I will give it a shot. I don't know how, but I actually understand what you are saying. I will post back with the results after I attempt the changes. Don't hold your breath... haha

12 Feb 2013, 4:28 AM
#8
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: MAP Pricing v1.5 - display strike-through on MAP Price?

When you find the define, post the original if it is not clear, and we can tell you for sure how to edit it.

12 Feb 2013, 4:33 AM
#9
johnnycopilot avatar

johnnycopilot

Zen Follower

Join Date:
Mar 2012
Posts:
325
Plugin Contributions:
0

Re: MAP Pricing v1.5 - display strike-through on MAP Price?

ok thanks.

12 Feb 2013, 7:38 AM
#10
johnnycopilot avatar

johnnycopilot

Zen Follower

Join Date:
Mar 2012
Posts:
325
Plugin Contributions:
0

Re: MAP Pricing v1.5 - display strike-through on MAP Price?

Ok, I did the following, but the appearance hasn't changed. Did I add the values to the CSS Correct?

I CHANGED/ADDED /includes/templates/abagon/css/stylesheet.css
FROM:
.map_pricing {
color: #FF0000;
font-weight: normal;
}

TO:
.map_pricing {text-decoration: strikethrough;
color: #FF0000;
font-weight: normal;
}

.map_pricing .noMap {text-decoration: none;
}

AND I CHANGED: /includes/languages/english/extra_definitions/map_pricing.php
FROM:
define('MAP_PRICE_STORE_FRONT_TEXT', "Priced so low we can't advertise it - Add to cart for price.");
define('MAP_PRICE_STORE_FRONT_TEXT_WITH_MAP_PRICE_DISPLAYED', 'for SALE price, add to cart');

TO:
define('MAP_PRICE_STORE_FRONT_TEXT', "Priced so low we can't advertise it - Add to cart for price.");
define('MAP_PRICE_STORE_FRONT_TEXT_WITH_MAP_PRICE_DISPLAYED', '<span class="noMap"> for SALE price, add to cart</span>');

When I do that, browser "View Source" shows this....

<!--bof Product Price block --> <h2 id="productPrices" class="productGeneral"> <span class="map_pricing">$399 <span class="noMap"> for SALE price, add to cart</span></span></h2> <!--eof Product Price block -->

I see my close span tag out of place, but that's about the limit of my knowledge.

ALSO, I tried adding ONLY the

.map_pricing {text-decoration: strikethrough;
color: #FF0000;
font-weight: normal;
}

to the stylesheet to see if it would strikethrough the price and text, but nothing there either; no strikethrough.
When I do that, browser 'view source' looks like this

<!--bof Product Price block --> <h2 id="productPrices" class="productGeneral"> <span class="map_pricing">$399 for SALE price, add to cart</span></h2> <!--eof Product Price block -->

I put both changes BACK in case you wanted to see what it looked like WITH the changes I tried, and that's the way it is currently.

12 Feb 2013, 4:38 PM
#11
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: MAP Pricing v1.5 - display strike-through on MAP Price?

Okay... I've never used line-through before, and it seems that it gets applied to the whole .map-pricing span regardless of styling in inner spans. You can set .noMap to an additional text-decoration, but you can't remove the outer effect.

It will be necessary to get sneaky. Change the define from```
define('MAP_PRICE_STORE_FRONT_TEXT_WITH_MAP_PRICE_DISPLAYED', '<span class="noMap"> for SALE price, add to cart</span>');

to```
define('MAP_PRICE_STORE_FRONT_TEXT_WITH_MAP_PRICE_DISPLAYED', '</span><span class="noMap"> for SALE price, add to cart');

This will close the .map-pricing span and put the text in a separate span. Now you can style them independently. You will have to repeat any styling you want them both to have.

.map_pricing {text-decoration: line-through;
color: #FF0000;
font-weight: normal;
}

.noMap {text-decoration: none;
color: #FF0000;
font-weight: normal;
}
12 Feb 2013, 10:44 PM
#12
johnnycopilot avatar

johnnycopilot

Zen Follower

Join Date:
Mar 2012
Posts:
325
Plugin Contributions:
0

Re: MAP Pricing v1.5 - display strike-through on MAP Price?

@gjh42 .... Sneaky!! Perfect!! And I love that I can change colors of text vs price. Having the price the same red as the text was driving me crazy. There IS one more thing, if I can bother you. If I put $0 for the M.A.P. price, instead of the site showing the M.A.P. price (now with my cool strikethrough), it shows the text in that other line in the map_pricing.php file.

define('MAP_PRICE_STORE_FRONT_TEXT', "Priced so low we can't advertise it - Add to cart for price.");

an example here; https://www.stageandtheaterlighting.com/index.php?main_page=product_info&cPath=97_105&products_id=1531

Since I have made the strikethrough change, that text now has a line through it and the new color of my M.A.P. price (which is fine if need be). Is there a way to give that message it's own attributes? I would like to get rid of the line through the text, and give it an altogether different color, blue or whatever. If it's going to open a new can of worms, I am not that concerned about it.. I mean, if it's going to take a lot of your time. I don't care how much of my time it takes..... and once again thanks..

13 Feb 2013, 5:49 AM
#13
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: MAP Pricing v1.5 - display strike-through on MAP Price?

I suspect you can do the same trick again, closing the span and starting another one with another class.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

13 Feb 2013, 5:54 AM
#14
johnnycopilot avatar

johnnycopilot

Zen Follower

Join Date:
Mar 2012
Posts:
325
Plugin Contributions:
0

Re: MAP Pricing v1.5 - display strike-through on MAP Price?

Thanks Dr. Byte, I'll give it a shot. I'll be back on the forum again in a few minutes when I crash my entire site.. ha.. Thanks!!

14 Feb 2013, 12:16 AM
#15
johnnycopilot avatar

johnnycopilot

Zen Follower

Join Date:
Mar 2012
Posts:
325
Plugin Contributions:
0

Re: MAP Pricing v1.5 - display strike-through on MAP Price?

Johnnycopilot:

I'll be back on the forum again in a few minutes when I crash my entire site.. ha
It's funny that I jokingly made the comment about crashing my site, because when I upload my map_pricing.php page with my edits, my website goes completely blank. everything. Like a white piece of paper. no content at all on entire website.. Thought I had really crashed it somehow. When I re-upload my working map_pricing.php file my website comes back. note: it seems like the m.a.p. install instructions said I needed to edit a product after install for website to 'work', so I DID edit or create a product between each of my changes... but still blank website. I would like to show the changes I made, and perhaps someone can correct me, and explain what I have done wrong.

Re-Capp, in case someone not familiar with this post starts reading: I am trying to give the text that shows up in lieu of price, when I put $0 in the M.A.P. price field, it's on text style. I am trying to give ----- define('MAP_PRICE_STORE_FRONT_TEXT', "</span><span class="noPrice">Priced so low we can't advertise it - Add to cart for price."); ---- it's own style.. However, I don't know what I am doing.

The define('MAP_PRICE_STORE_FRONT_TEXT_WITH_MAP_PRICE_DISPLAYED', '</span><span class="noMap">for SALE price, add to cart'); edit works great. It separated the price and subsequent text into two fields, which allowed me to give the price and text their own styles (...which shows up when $1 or more is entered in the M.A.P. price field).

** Question:: Can I name a style "noPrice" ??

This is the current, working map_pricing.php page with the strikethrough mod in place.
define('MAP_PRICE_STORE_FRONT_TEXT', "Priced so low we can't advertise it - Add to cart for price.");
define('MAP_PRICE_STORE_FRONT_TEXT_WITH_MAP_PRICE_DISPLAYED', '</span><span class="noMap">for SALE price, add to cart');

This is the current working theme stylesheet

.map_pricing {text-decoration: line-through;
color: #808080;
font-weight: normal;
}

.noMap {text-decoration: none;
color: #FF0000;
font-weight: normal;

Here are the changes I made, none of which work.

Change (1)
define('MAP_PRICE_STORE_FRONT_TEXT', "</span><span class="noPrice">Priced so low we can't advertise it - Add to cart for price.");
define('MAP_PRICE_STORE_FRONT_TEXT_WITH_MAP_PRICE_DISPLAYED', '</span><span class="noMap">for SALE price, add to cart');

.map_pricing {text-decoration: line-through;
color: #808080;
font-weight: normal;
}

.noMap {text-decoration: none;
color: #FF0000;
font-weight: normal;
}

.noPrice {text-decoration: none;
color: #0000FF;
font-weight: normal;

Change (2)
define('MAP_PRICE_STORE_FRONT_TEXT', </span><span class="noPrice">"Priced so low we can't advertise it - Add to cart for price.");
define('MAP_PRICE_STORE_FRONT_TEXT_WITH_MAP_PRICE_DISPLAYED', '</span><span class="noMap">for SALE price, add to cart');

Same style sheet as in change 1

Change (3)
define('MAP_PRICE_STORE_FRONT_TEXT', '</span><span class="noPrice">"Priced so low we can't advertise it - Add to cart for price." ');
define('MAP_PRICE_STORE_FRONT_TEXT_WITH_MAP_PRICE_DISPLAYED', '</span><span class="noMap">for SALE price, add to cart');

same style sheet as in change 1

Change (4)
define('MAP_PRICE_STORE_FRONT_TEXT', '</span><span class="noPrice">' "Priced so low we can't advertise it - Add to cart for price.");
define('MAP_PRICE_STORE_FRONT_TEXT_WITH_MAP_PRICE_DISPLAYED', '</span><span class="noMap">for SALE price, add to cart');

same stylesheet as in change 1

What am I doing wrong? Thanks! :)

14 Feb 2013, 1:12 AM
#16
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: MAP Pricing v1.5 - display strike-through on MAP Price?

One apostrophe is killing you:)

define('MAP_PRICE_STORE_FRONT_TEXT', "</span><span class="noPrice">Priced so low we can't advertise it - Add to cart for price.");

When the code processes the "can't", it sees the apostrophe as terminating the string content, and then blows up because what follows makes no sense as PHP code. You need to escape the apostrophe with a backslash: '

define('MAP_PRICE_STORE_FRONT_TEXT', "</span><span class="noPrice">Priced so low we can\'t advertise it - Add to cart for price.");

Or not... just noticed the double quotes on the second string content, which gets around the need for escaping that. It does not get around the need for escaping the double quotes on "noPrice", which needs to be "noPrice".

define('MAP_PRICE_STORE_FRONT_TEXT', "</span><span class=\"noPrice\">Priced so low we can't advertise it - Add to cart for price.");
14 Feb 2013, 10:00 AM
#17
johnnycopilot avatar

johnnycopilot

Zen Follower

Join Date:
Mar 2012
Posts:
325
Plugin Contributions:
0

Re: MAP Pricing v1.5 - display strike-through on MAP Price?

That got it. Thanks, and thanks for the lesson. This is interesting. I would like to ask you a few yes or no questions if you don't mind. This thread can be finished as far as I am concerned because my problem is solved; so if you're too busy I understand.

  1. Is this a numbers game with the opening and closing tags, in the respect that; if it starts with an apostrophe, the next apostrophe ends the string; and the next thing after the closing apostrophe must be some sort of starting php tag (apostrophe or quotes, (echo?) or whatever else there is)?

  2. Did the writers of this mod start the original "Priced so low we can't advertise it - Add to cart for price." with quotes because they knew they wanted to have the word can't in the phrase?... so they used quotes to start the string instead of an apostrophe?,, and then they used apostrophe to start the other phrase 'for SALE price, add to cart' because apostrophe is a more common thing to use to start a string in php? If I wanted to add a word with an apostrophe in the 2nd phrase, 'for SALE price, add to cart' ,,, would I either need to escape the apostrophe with a backslash, OR wrap the entire phrase in quotes instead of apostrophe's, and that would allow me to use apostrophe's within the quotes?

For example, could I have written it like this
define('MAP_PRICE_STORE_FRONT_TEXT', '</span><span class="noPrice">Priced so low we can/'t advertise it - Add to cart for price.');

It's confusing because the 2nd phrase is wrapped in apostrophes, and the 1st phrase is wrapped in quotes; and one little thing disabled my entire website. I will never know without finding out here or asking Google, and you explain things a lot better than him.

14 Feb 2013, 7:15 PM
#18
johnnycopilot avatar

johnnycopilot

Zen Follower

Join Date:
Mar 2012
Posts:
325
Plugin Contributions:
0

Re: MAP Pricing v1.5 - display strike-through on MAP Price?

@Dr. Byte and Kobra... I have some questions about some of the issues that you or Kobra (think it was Kobra) mentioned earlier in this post,, but my question is, should I start new threads about those particular issues if they are not related to the topic title of this post? Thanks for all of your help, this forum is the best one, by far, of any that I am a part of... and like I said in the previous post, you guys (and girls) explain things much better than I can ever seem to find on Mr. Google.. Since it's Feb 14th, I hope that everyone has a Happy Valentines Day

14 Feb 2013, 9:17 PM
#19
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: MAP Pricing v1.5 - display strike-through on MAP Price?

should I start new threads about those particular issues if they are not related to the topic title of this post
I would say yes - for the sake of the community seeking answers to similar issues
A distinct title in the proper category is helpful

Zen-Venom Get Bitten

15 Feb 2013, 8:32 PM
#20
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: MAP Pricing v1.5 - display strike-through on MAP Price?

For example, could I have written it like this
define('MAP_PRICE_STORE_FRONT_TEXT', '</span><span class="noPrice">Priced so low we can/'t advertise it - Add to cart for price.');Yes, except that it is a backslash \ that escapes characters.```php
define('MAP_PRICE_STORE_FRONT_TEXT', '</span><span class="noPrice">Priced so low we can't advertise it - Add to cart for price.');

Single quotes are most common for PHP string delineation, possibly because most HTML (which PHP frequently handles) uses double quotes " " as a general practice. There are also differences in the way PHP processes single and double quotes, but that is for more advanced handling and you don't need to worry about it.

Single-quoted strings will ignore double quotes inside them, and vice versa, as you have seen. I expect you are right about the original define setup.