phpconstantszen-cart

What's causing this php define() method to not function?


I'm building a site using Zen Cart and I've changed a define() in a .php file. Whatever I've done has stopped the function of the program and I can't figure out why.

The only elements I've eliminated are the list tags and the "strong" tags. Are they somehow essential to defining the constant?

The first is my edit, the second is the stock method (I broke them up like that to search for my errors):

define('EMAIL_TEXT', 'You are now registered with our little buying group and have account privileges on this site.' . "\n\n" . 

'Please remember that you can order as many or as few items as you like but if we as a group do not reach case amounts then we can't bring the item in.' . "\n\n" . 

'Please also remember that produce prices vary day to day and week to week.  The prices listed on this site are estimates only.  Expect the final cost to reflect these small fluctuations.  Before I place an order I will send out a group email that will mention any particularly egregious price hikes.' . "\n\n" . 

'You will need to pick up your items from my house in a timely manner.  I can't be held responsible for lettuce wilting in my garage while you're skiing at Liberty all weekend.' . "\n\n" . 

'I'm glad you joined us.  The more people we get, the more produce we should be able to order and the more we order the more I can negotiate better pricing.' . "\n\n" . 

'Here's to eating organic!' . "\n\n" );


define('EMAIL_TEXT', 'You are now registered with our store and have account privileges:  With your account, you can now take part in the <strong>various services</strong> we have to offer you. Some of these many services include:' . "\n\n<ul>" . 

'<li><strong>Order History</strong> - View the details of orders you have completed with us.' . "\n\n" . 

'<li><strong>Permanent Cart</strong> - Any products added to your online cart remain there until you remove them, or check them out.' . "\n\n" . 

'<li><strong>Address Book</strong> - We can deliver your products to an address other than yours! This is perfect to send birthday gifts direct to the birthday-person themselves.' . "\n\n" . 

'<li><strong>Products Reviews</strong> - Share your opinions on our products with other customers.' . "\n\n</ul>");

Solution

  • The problem is the extra apostrophe in the following line that is terminating the definition early:

    'Here's to eating organic
    

    You need to escape the second apostrophe - simply change it to:

    'Here\'s to...
    

    Edit: There are some others too, such as:

    'I'm...
    

    should be

    'I\'m...
    

    Alternatively reformat the string as follows as I think you'll agree it is more legible and there is less of the concatenation:

    "I'm ... \n\n".
    "Here's to organic\n\n".
    ...