X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   PO Numbers on Invoices, Searchable in Orders. (https://forum.x-cart.com/showthread.php?t=31653)

migol3 04-05-2011 04:56 AM

Re: PO Numbers on Invoices, Searchable in Orders.
 
I just added this hack to order_invoice.tpl. It displays the PO number by using regex in the smarty template to remove everything after the first line break in $order.details.

{if $order.payment_method eq "Purchase Order"}{$order.details|regex_replace:"/[\n].*/":""}{/if}

notgrass 02-22-2012 07:04 PM

Re: PO Numbers on Invoices, Searchable in Orders.
 
I finally got this mod to work on v4.4.4. It was not working when the po_number field in the database was set to VARCHAR. But when I changed it to text, it worked. Weird!

But thank you, Russell, for the great modification!

kcmastrpc 05-08-2012 11:50 AM

Re: PO Numbers on Invoices, Searchable in Orders.
 
Having an issue with getting this to work.

I can insert a table entry for po_number manually, and it'll show up just fine in searches, etc. but as soon as I go to create a new order through xcart I get an error.

Warning
403
Access denied !

You are not allowed to access that resource!

Id: 79

This error no longer occurs if I remove:

'po_number' => addslashes(getPONum($order_details)),

from func.order.php

I've tried changing the dbtype to text from varchar, but that didn't help.

Raptor 08-20-2012 08:43 PM

Re: PO Numbers on Invoices, Searchable in Orders.
 
Is this working with 4.5.1 ?

fonefun 09-05-2012 05:30 AM

Re: PO Numbers on Invoices, Searchable in Orders.
 
will this mode work on 4.5.2?

Berto 09-05-2012 11:34 AM

Re: PO Numbers on Invoices, Searchable in Orders.
 
Quote:

Originally Posted by fonefun
will this mode work on 4.5.2?


Hasn't been tested higher than 4.4.x (see notgrass' post above) but you could be the first! :-)

keninfortmyers 12-30-2012 02:30 PM

Re: PO Numbers on Invoices, Searchable in Orders.
 
:-) This mod works great in 4.5.4 I'm using it

bitNine 03-31-2014 12:04 PM

Re: PO Numbers on Invoices, Searchable in Orders.
 
Quote:

Originally Posted by kcmastrpc
Having an issue with getting this to work.

I can insert a table entry for po_number manually, and it'll show up just fine in searches, etc. but as soon as I go to create a new order through xcart I get an error.

Warning
403
Access denied !

You are not allowed to access that resource!

Id: 79

This error no longer occurs if I remove:

'po_number' => addslashes(getPONum($order_details)),

from func.order.php

I've tried changing the dbtype to text from varchar, but that didn't help.


I hate bumping old threads, but I ran across this thread while trying to determine the reason for an almost identical error while modifying a module, and wanted to provide my solution.

Clear the x-cart cache. It's that easy. I made a change to code that involves inserting data into a modified db table using the array2insert function built into x-cart. Apparently x-cart caches information about that table, and would throw this error when I'd provide 2 extra columns in the array. Clearing the cache solved it.


All times are GMT -8. The time now is 12:36 AM.

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