Solved

php syntax

Posted on 2011-03-08
5
401 Views
Last Modified: 2012-05-11
I have this code:

<?      echo __('Oops, there is nothing in your cart.', 'wpsc') . " <a href='".get_option("product_list_url")."'>" . __('Please visit our shop', 'wpsc') . "</a>";
endif;
?>

I need to wrap the phrase like this:

<div style = "margin-top:75px"> echo __('Oops, there is nothing in your cart.', 'wpsc') . " <a href='".get_option("product_list_url")."'>" . __('Please visit our shop', 'wpsc') . "</a>" </div>


but it has to be in PHP - I am having difficulty writing this. Can anyone help out?
0
Comment
Question by:lvollmer
  • 3
  • 2
5 Comments
 
LVL 11

Accepted Solution

by:
patsmitty earned 500 total points
ID: 35074754
Try the following code:  
echo('<div style = "margin-top:75px">');
echo __('Oops, there is nothing in your cart.', 'wpsc');
echo(' <a href="get_option(/'product_list_url/')">');
echo__('Please visit our shop', 'wpsc');
echo('</a></div>');

Open in new window

0
 

Author Closing Comment

by:lvollmer
ID: 35074783
thanks!
0
 
LVL 11

Expert Comment

by:patsmitty
ID: 35074801
Sorry, line 3 should be this instead:
 
echo(' <a href="get_option(\'product_list_url\')">');

Open in new window

I got the slashes reversed.
0
 

Author Comment

by:lvollmer
ID: 35074838
yes i figured as much and made the change thank you!
0
 
LVL 11

Expert Comment

by:patsmitty
ID: 35074893
Cool, glad I could help!

Cheers
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
DNS, website, godaddy 6 42
get radio button vale in array 7 37
Editing login page in zencart. 2 14
Adjust the position 3 12
This article discusses how to create an extensible mechanism for linked drop downs.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now