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)
-   -   Customer messages on invoices (https://forum.x-cart.com/showthread.php?t=60880)

easyserve 09-13-2011 05:32 PM

Customer messages on invoices
 
Hi all,

I use custom text fields on invoices to advise customers of news relating to that product. i need that news to appear on the actual invoice. the text fields require no input from customers. how do i delete the text boxes on invoices for certain products only?

to see mt currrent method go to: http://www.easyserve.com.au/product.php?productid=25185&cat=329&page=1.

Thanking you in advance.

Bill Zammit

totaltec 09-14-2011 06:39 AM

Re: Customer messages on invoices
 
This is probably not the most elegant solution, but here is an overview of how I would code this:

Create a new checkbox on the product details page, something like
Is ticket? []

This checkbox will need a value of Y if checked, and a new field in the product table of the db to hold the value.

Then in your product details template file you can check if this product is a ticket with an if statement,
{if $product.is_ticket = 'Y'}{include file="customer/main/is_ticket.tpl"}{/if}
and then if it is it will display a custom template file that you create with the message inside. It could just display a language variable actually.

If you need the message to change for each ticket product you sell, you can create another field on the product page that stores the message.

You can then use an if statement on the invoice as well to display the message.

There may be other steps required but this should help you understand how I would do it.

easyserve 09-14-2011 04:55 PM

Re: Customer messages on invoices
 
Hi Mike,

thanks very much for taking the time and trouble to answer my question. i really appreciate the effort you went to. Bill

gb2world 09-14-2011 09:05 PM

Re: Customer messages on invoices
 
Alternatively, if you are happy with the way the options are displaying on your invoice, but just want to change the display on the product page, you can use webmastermode to find the template that displays the product options and look at the $product_options array. For your version - it is a little harder to look at smarty variables, but if you go to the extra trouble - it makes things like this much easier. See this tip.

There will be a loop to display all the options as inputs for the form. It will look something like this: {foreach from=$product_options item=v}

Then you could name your options something like "message1" and "message2"

You can put an if/than statement inside that loop and look at the class (option name) and displays the option text as you want. Something like:


{if $v.class eq "message1" || $v.class eq "message2"}
<!-- Here is the message -->
<p>{$v.classtext}</p>

{else}
... display options as normal as inputs for the form for all options with other option names
{/if}

---


All times are GMT -8. The time now is 09:50 PM.

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