X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Help adding a <br> tag in a php file for listed products (https://forum.x-cart.com/showthread.php?t=38464)

mmoskva 03-20-2008 07:20 AM

Help adding a <br> tag in a php file for listed products
 
Currently I have this code in my php file:
$giftcert["message"] = "".func_get_langvar_by_name("txt_message").":\n".$ product_line;

and it currently will display something like this in the email notification:
ex. You purchased: Coffee maker E37 Dodgers 07 Baseball Cap Graphic Tee Mens


(BUT)

I would like to have a <br> tag added with each product that is listed, see example below:
ex.
You purchased:
Coffee maker E37
Dodgers 07 Baseball Cap
Graphic Tee Mens


Can someone help me out? If its easier to add a COMMA between products that would be fine for me to.
ex. You purchased: Coffee maker E37, Dodgers 07 Baseball Cap, Graphic Tee Mens

Yurij 03-21-2008 01:33 AM

Re: Help adding a <br> tag in a php file for listed products
 
Quote:

Originally Posted by mmoskva
Currently I have this code in my php file:
$giftcert["message"] = "".func_get_langvar_by_name("txt_message").":\n".$ product_line;

and it currently will display something like this in the email notification:
ex. You purchased: Coffee maker E37 Dodgers 07 Baseball Cap Graphic Tee Mens


(BUT)

I would like to have a <br> tag added with each product that is listed, see example below:
ex.
You purchased:
Coffee maker E37
Dodgers 07 Baseball Cap
Graphic Tee Mens


Can someone help me out? If its easier to add a COMMA between products that would be fine for me to.
ex. You purchased: Coffee maker E37, Dodgers 07 Baseball Cap, Graphic Tee Mens


Before that line should be where the cycle would read something like:
PHP Code:

$product_line . = ...some variable


change this line, add one <br> tag - ."<br>";

PHP Code:

$product_line . = ...some variable."<br>"


mmoskva 03-22-2008 08:47 AM

Re: Help adding a <br> tag in a php file for listed products
 
Thank you it worked perfict.

- I have another question if i wanted this change to display only on the customer-end, could you help me out w/ the (ie. if, else) statement that i should include.

Yurij 03-24-2008 12:16 AM

Re: Help adding a <br> tag in a php file for listed products
 
Quote:

Originally Posted by mmoskva
Thank you it worked perfict.

- I have another question if i wanted this change to display only on the customer-end, could you help me out w/ the (ie. if, else) statement that i should include.


Explain to me what is - "customer-end"?
Checkout, confirmation page or ...?

mmoskva 03-24-2008 05:43 AM

Re: Help adding a <br> tag in a php file for listed products
 
When i am using tpl files if i want to display something in a particular way for customers to see VS admin/provider users etc.. i would apply something like the below.

example.

"C" means customer-end users:

{if $usertype eq "C"}
<FONT class="DetailsTitle">{$lng.txt_header}</FONT>
{else}
{$lng.txt_header}
{/if}



Q. how do i write this IF,ELSE statement but in php with the below example.

$product_line .= "\n".$product['product'].' #'.$product['productid']."<BR></BR>";

Yurij 03-25-2008 12:15 AM

Re: Help adding a <br> tag in a php file for listed products
 
Example for customer or affiliate.

PHP Code:

if ($current_area == "C" || $current_area == "B") {
{





All times are GMT -8. The time now is 05:45 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.