POS product attribute text result not showing in receipt

Phoca Cart - complex e-commerce extension
andressolano
Phoca Newbie
Phoca Newbie
Posts: 9
Joined: 15 Feb 2022, 23:20

POS product attribute text result not showing in receipt

Post by andressolano »

Hi, I added a attribute to a product which is a text, the idea is that the user in the POS write the a text in the field of the product, but when the checkout is done, it shows a receipt that I want to sent to the costumer, but this is not showing the text typed in the attribute field. Any idea where is the problem?

Tags:
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48386
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: POS product attribute text result not showing in receipt

Post by Jan »

Hi, yes, the text can be e.g. personal information, etc. and such does not belong to legal document like e.g. invoice or receipt is :idea:

Jan
If you find Phoca extensions useful, please support the project
andressolano
Phoca Newbie
Phoca Newbie
Posts: 9
Joined: 15 Feb 2022, 23:20

Re: POS product attribute text result not showing in receipt

Post by andressolano »

in this case I'm creating an attribute field, text. So this attribute can be use as a product note fill by the user of the POS. I want this note to be show in the receipt created by the POS, at this moment the receipt is showing the name of the attribute field but not what the user wrote in the attribute field which is estrange
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48386
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: POS product attribute text result not showing in receipt

Post by Jan »

Hi, for now, this needs to be customized in the code - e.g. per template override:

components/com_phocacart/layouts/order.php line cca 691 (just uncomment the commented code):

Code: Select all

if (!empty($v->attributes)) {
			$p[] = '<tr>';
			$p[] = '<td></td>';
			$p[] = '<td colspan="3" align="left"><ul class="ph-idnr-ul">';
			foreach ($v->attributes as $k2 => $v2) {
				$p[] = '<li><span class="ph-small ph-cart-small-attribute ph-idnr-li">'.$v2->attribute_title .' '.$v2->option_title.'</span></li>';

				/* Should we display the values of attributes added by users in order/delivery note/receipt/invoice?

				$p[] = '<li><span class="ph-small ph-cart-small-attribute ph-idnr-li">'.$v2->attribute_title .' '.$v2->option_title.'</span>';
				 if (isset($v2->option_value) && urldecode($v2->option_value) != '') {
                    $p[] =  ': <span class="ph-small ph-cart-small-attribute">' . htmlspecialchars(urldecode($v2->option_value), ENT_QUOTES, 'UTF-8') . '</span>';
                }
				$p[] = '</li>';
				*/

				if ($pR) { $oPr[] = $pP->printLineColumns(array(' - ' .$v2->attribute_title .' '.$v2->option_title)); }

			}
			$p[] = '</ul></td>';
			$p[] = '<td colspan="8"></td>';
			$p[] = '</tr>';
		}
If you find Phoca extensions useful, please support the project
User avatar
Nobbie
Phoca Newbie
Phoca Newbie
Posts: 7
Joined: 08 Jan 2022, 00:58

Re: POS product attribute text result not showing in receipt

Post by Nobbie »

Hallo Jan,
Für meinen Shop benötige ich Kommentarfeld, das vom Kunden ausgefüllt werden kann und bin auf diesen Beitrag gestossen.
Ich habe ein Template Override erstellt und den Code auskommentiert, bekomme dann aber Fehlermeldungen im Warenkorb beim bestellen.
Wenn ich den Code wieder auskommentiere dann funktioniert wieder alles wie gewohnt.
Vielleicht gibt es eine Lösung dafür, würde mir sehr weiterhelfen.

vielen Dank

Ich verwende :
  • Joomla 4.4.2
  • PhocaCart 4.0.10
als Template nutze ich das Tempate "Joomla 4 Cassiopeia Template Customization - Child template"

https://www.linelab.org/tutorials/jooml ... d-template

Link zu einem Produkt mit diesen Feldern
http://demo.tsv-offenstetten.de/fb-shop ... cke-unisex

1. Bestellbutton funktioniert nicht mehr
https://i.imgur.com/tNIRkOR.jpg

2. Errorpage wird angezeigt
https://i.imgur.com/OVSDNcT.jpg

Code: Select all

Call stack
#	Function	Location
1	()	JROOT/templates/cassiopeia_tsv_demo_shop/html/layouts/com_phocacart/order.php:708
2	Joomla\CMS\Layout\FileLayout->render()	JROOT/administrator/components/com_phocacart/libraries/phocacart/order/render.php:183
3	PhocacartOrderRender->render()	JROOT/administrator/components/com_phocacart/libraries/phocacart/order/status.php:600
4	PhocacartOrderStatus::changeStatus()	JROOT/administrator/components/com_phocacart/libraries/phocacart/order/order.php:1246
5	PhocacartOrder->saveOrderMain()	JROOT/components/com_phocacart/controllers/checkout.php:943
6	PhocaCartControllerCheckout->order()	JROOT/libraries/src/MVC/Controller/BaseController.php:693
7	Joomla\CMS\MVC\Controller\BaseController->execute()	JROOT/components/com_phocacart/phocacart.php:18
8	require_once()	JROOT/libraries/src/Dispatcher/LegacyComponentDispatcher.php:71
9	Joomla\CMS\Dispatcher\LegacyComponentDispatcher::Joomla\CMS\Dispatcher\{closure}()	JROOT/libraries/src/Dispatcher/LegacyComponentDispatcher.php:73
10	Joomla\CMS\Dispatcher\LegacyComponentDispatcher->dispatch()	JROOT/libraries/src/Component/ComponentHelper.php:361
11	Joomla\CMS\Component\ComponentHelper::renderComponent()	JROOT/libraries/src/Application/SiteApplication.php:208
12	Joomla\CMS\Application\SiteApplication->dispatch()	JROOT/libraries/src/Application/SiteApplication.php:249
13	Joomla\CMS\Application\SiteApplication->doExecute()	JROOT/libraries/src/Application/CMSApplication.php:293
14	Joomla\CMS\Application\CMSApplication->execute()	JROOT/includes/app.php:61
15	require_once()	JROOT/index.php:32
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48386
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: POS product attribute text result not showing in receipt

Post by Jan »

Hallo,

die Error Seite sagt einfach, da ist ein Syntax Error, etwas is falsch in PHP Kode, was aber, muss dein Editor or IDE sagen.

auf der ersten Website, da sind Warnings, dass man Variablen benutzt, die nicht existieren.

Jan
If you find Phoca extensions useful, please support the project
User avatar
Nobbie
Phoca Newbie
Phoca Newbie
Posts: 7
Joined: 08 Jan 2022, 00:58

Re: POS product attribute text result not showing in receipt

Post by Nobbie »

Vielen Dank für die schnelle Rückmeldung und Hinweise.
  • "1. Bestellbutton funktioniert nicht mehr" - hier hatte ich Fehler berichten auf "Maximum" gestellt. Bei "Standard" funktioniert der Button, nur das Icon wird nicht angezeigt, stört aber nicht
  • "2. Errorpage wird angezeigt" - war mein Fehler, hatte einen Infotext nicht richtig auskommentiert
Jetzt funktioniert alles, bin sehr zufrieden.
Kann als gelöst markiert werden.

Vielen Dank
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48386
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: POS product attribute text result not showing in receipt

Post by Jan »

Hallo, OK, danke für Info.

Jan
If you find Phoca extensions useful, please support the project
Post Reply