Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 21
  1. #11
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default 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
    Code:
    define('MAP_PRICE_STORE_FRONT_TEXT_WITH_MAP_PRICE_DISPLAYED', '<span class="noMap"> for SALE price, add to cart</span>');
    to
    Code:
    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.
    Code:
    .map_pricing {text-decoration: line-through;
    color: #FF0000;
    font-weight: normal;
    }
    
    .noMap {text-decoration: none;
    color: #FF0000;
    font-weight: normal;
    }
    Last edited by gjh42; 12 Feb 2013 at 05:41 PM.

  2. #12
    Join Date
    Mar 2012
    Posts
    315
    Plugin Contributions
    0

    Default 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....oducts_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..

  3. #13
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default 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.

  4. #14
    Join Date
    Mar 2012
    Posts
    315
    Plugin Contributions
    0

    Default 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!!

  5. #15
    Join Date
    Mar 2012
    Posts
    315
    Plugin Contributions
    0

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

    Quote Originally Posted by Johnnycopilot View Post
    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! :)

  6. #16
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

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

    One apostrophe is killing you:)
    PHP Code:
    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: \'

    PHP Code:
    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\".
    PHP Code:
    define('MAP_PRICE_STORE_FRONT_TEXT'"</span><span class=\"noPrice\">Priced so low we can't advertise it - Add to cart for price."); 
    Last edited by gjh42; 14 Feb 2013 at 02:15 AM.

  7. #17
    Join Date
    Mar 2012
    Posts
    315
    Plugin Contributions
    0

    Default 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.

  8. #18
    Join Date
    Mar 2012
    Posts
    315
    Plugin Contributions
    0

    Default 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

  9. #19
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default 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

  10. #20
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default 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 Code:
    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.

 

 
Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. Can you have both the MSRP Display and MAP Pricing Plugins?
    By SilverHD in forum All Other Contributions/Addons
    Replies: 4
    Last Post: 13 Jan 2014, 10:14 PM
  2. MAP Pricing
    By skookumnarrows in forum Addon Templates
    Replies: 12
    Last Post: 20 Jun 2011, 06:29 PM
  3. MAP Pricing
    By tbaquatics in forum All Other Contributions/Addons
    Replies: 8
    Last Post: 6 Oct 2009, 01:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg