Post by MateusAMOK » Mon Apr 11, 2022 11:39 pm

Hello.
I need to fill in this field below, with the value of the product WITHOUT TAX, next to it, presenting the value WITH TAX, as it is. How to do this?

Tks.


Image
Last edited by MateusAMOK on Wed Apr 13, 2022 1:24 am, edited 1 time in total.

Newbie

Posts

Joined
Mon Apr 11, 2022 11:13 pm

Post by mikeinterserv » Tue Apr 12, 2022 12:57 am

That part of the cart has totals only.
You are going to need get the product price from the cart controller and make it available to the twig view
Then alter the twig view to reflect how you want the data. I will make an extension for it if you want.
Did you search the marketplace for extensions for cart ?

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by MateusAMOK » Tue Apr 12, 2022 1:06 am

mikeinterserv wrote:
Tue Apr 12, 2022 12:57 am
That part of the cart has totals only.
You are going to need get the product price from the cart controller and make it available to the twig view
Then alter the twig view to reflect how you want the data. I will make an extension for it if you want.
Did you search the marketplace for extensions for cart ?
Unfortunatly i have already tried to edit the cart controller, but it seems like it wont apply any changes i make to that file, when i try to reflect the data on the twig file it stays empty.
Is this somekind of known issue with the controller file ???

Newbie

Posts

Joined
Mon Apr 11, 2022 11:13 pm

Post by mikeinterserv » Tue Apr 12, 2022 1:28 am

Well you didn't do it right
Do you want it too look like this
There is NO KNOWN ISSUE with the controller at all, as you put it.
What THEME are you using and what OTHER EXTENSIONS do you have installed

Attachments

Clipboard01.jpg

Clipboard01.jpg (11.43 KiB) Viewed 1575 times


Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by MateusAMOK » Tue Apr 12, 2022 1:43 am

mikeinterserv wrote:
Tue Apr 12, 2022 1:28 am
Well you didn't do it right
Do you want it too look like this
There is NO KNOWN ISSUE with the controller at all, as you put it.
What THEME are you using and what OTHER EXTENSIONS do you have installed
how can i make it work like yours ? can you share your code ?

Newbie

Posts

Joined
Mon Apr 11, 2022 11:13 pm

Post by mikeinterserv » Tue Apr 12, 2022 1:47 am

MateusAMOK wrote:
Tue Apr 12, 2022 1:43 am
how can i make it work like yours ? can you share your code ?
Not normally
But here
Twig
Change

Code: Select all

<td class="text-right"> {{ product.price }}</td>
TO

Code: Select all

<td class="text-right">{{ product.extaxprice }}: Ex Tax<br> {{ product.price }}: Inc tax</td>
Controller FIND

Code: Select all

				$data['products'][] = array(
					'cart_id'   => $product['cart_id'],
					'thumb'     => $image,
					'name'      => $product['name'],
					'model'     => $product['model'],
					'option'    => $option_data,
					'recurring' => $recurring,
					'quantity'  => $product['quantity'],
					'stock'     => $product['stock'] ? true : !(!$this->config->get('config_stock_checkout') || $this->config->get('config_stock_warning')),
					'reward'    => ($product['reward'] ? sprintf($this->language->get('text_points'), $product['reward']) : ''),
					'price'     => $price,
					'total'     => $total,
					'href'      => $this->url->link('product/product', 'product_id=' . $product['product_id'])
and ADD extaxprice

Code: Select all

				$data['products'][] = array(
					'cart_id'   => $product['cart_id'],
					'thumb'     => $image,
					'name'      => $product['name'],
					'model'     => $product['model'],
					'option'    => $option_data,
					'recurring' => $recurring,
					'quantity'  => $product['quantity'],
					'stock'     => $product['stock'] ? true : !(!$this->config->get('config_stock_checkout') || $this->config->get('config_stock_warning')),
					'reward'    => ($product['reward'] ? sprintf($this->language->get('text_points'), $product['reward']) : ''),
					'price'     => $price,
					'total'     => $total,
					'extaxprice' => $this->currency->format($product['price'], $this->session->data['currency']),
					'href'      => $this->url->link('product/product', 'product_id=' . $product['product_id'])
Exit :-)
Last edited by mikeinterserv on Tue Apr 12, 2022 2:26 am, edited 1 time in total.

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by mikeinterserv » Tue Apr 12, 2022 1:59 am

There is an error in that code I will change it.
OK I have changed the code above, sorry.
Works perfect now

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by phpscript7 » Tue Apr 12, 2022 1:42 pm

If it is solved now you write [Solved] in the title - Thank you

New member

Posts

Joined
Wed Jan 04, 2017 3:55 pm

Post by MateusAMOK » Tue Apr 12, 2022 9:48 pm

mikeinterserv wrote:
Tue Apr 12, 2022 1:47 am
MateusAMOK wrote:
Tue Apr 12, 2022 1:43 am
how can i make it work like yours ? can you share your code ?
Not normally
But here
Twig
Change

Code: Select all

<td class="text-right"> {{ product.price }}</td>
TO

Code: Select all

<td class="text-right">{{ product.extaxprice }}: Ex Tax<br> {{ product.price }}: Inc tax</td>
Controller FIND

Code: Select all

				$data['products'][] = array(
					'cart_id'   => $product['cart_id'],
					'thumb'     => $image,
					'name'      => $product['name'],
					'model'     => $product['model'],
					'option'    => $option_data,
					'recurring' => $recurring,
					'quantity'  => $product['quantity'],
					'stock'     => $product['stock'] ? true : !(!$this->config->get('config_stock_checkout') || $this->config->get('config_stock_warning')),
					'reward'    => ($product['reward'] ? sprintf($this->language->get('text_points'), $product['reward']) : ''),
					'price'     => $price,
					'total'     => $total,
					'href'      => $this->url->link('product/product', 'product_id=' . $product['product_id'])
and ADD extaxprice

Code: Select all

				$data['products'][] = array(
					'cart_id'   => $product['cart_id'],
					'thumb'     => $image,
					'name'      => $product['name'],
					'model'     => $product['model'],
					'option'    => $option_data,
					'recurring' => $recurring,
					'quantity'  => $product['quantity'],
					'stock'     => $product['stock'] ? true : !(!$this->config->get('config_stock_checkout') || $this->config->get('config_stock_warning')),
					'reward'    => ($product['reward'] ? sprintf($this->language->get('text_points'), $product['reward']) : ''),
					'price'     => $price,
					'total'     => $total,
					'extaxprice' => $this->currency->format($product['price'], $this->session->data['currency']),
					'href'      => $this->url->link('product/product', 'product_id=' . $product['product_id'])
Exit :-)
I tried to do it as you had it, copied your code but it seems to have no effect, any additions i make to the controller file makes no changes as i already said before.
i have already tried to delete the cart.php file and create a new one with the new code already added.
Am i changing the correct controler file ?
public_html/catalog/controller/checkout/cart.php

Newbie

Posts

Joined
Mon Apr 11, 2022 11:13 pm

Post by mikeinterserv » Tue Apr 12, 2022 11:26 pm

Then you must have a modification using the cart file OR you have edited it in the theme editor.
catalog/controller/checkout/cart.php is the correct file.
I will make a modification for you and you can see if that works.

I asked you before - WHAT THEME and EXTENSIONS are you using.

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by MateusAMOK » Tue Apr 12, 2022 11:50 pm

mikeinterserv wrote:
Tue Apr 12, 2022 11:26 pm
Then you must have a modification using the cart file OR you have edited it in the theme editor.
catalog/controller/checkout/cart.php is the correct file.
I will make a modification for you and you can see if that works.

I asked you before - WHAT THEME and EXTENSIONS are you using.
Im using the DEFAULT THEME and NO CART EXTENSIONS
No modification using the cart file other then this one im trying, and havent edited it in the theme editor, also my problem is getting the value i can edit the twig without any issue.

thx

Newbie

Posts

Joined
Mon Apr 11, 2022 11:13 pm

Post by cyclops12 » Wed Apr 13, 2022 12:14 am

Are you clearing all your caches after making changes?

Expert Member

Posts

Joined
Sun Sep 27, 2015 1:10 am

Post by MateusAMOK » Wed Apr 13, 2022 12:22 am

cyclops12 wrote:
Wed Apr 13, 2022 12:14 am
Are you clearing all your caches after making changes?
Yes, I always clear my cache

Newbie

Posts

Joined
Mon Apr 11, 2022 11:13 pm

Post by mikeinterserv » Wed Apr 13, 2022 12:26 am

Try this
Its an XML mod.
I will make an events one as well
Last edited by mikeinterserv on Wed Apr 13, 2022 1:47 am, edited 1 time in total.

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by MateusAMOK » Wed Apr 13, 2022 12:38 am

mikeinterserv wrote:
Wed Apr 13, 2022 12:26 am
Try this
Its an XML mod.
I will make an events one as well
The extension this active, but not edited the price

Image
Image

Newbie

Posts

Joined
Mon Apr 11, 2022 11:13 pm

Post by mikeinterserv » Wed Apr 13, 2022 12:45 am

OK i in modifications you will see LOG
Find the line that starts with this below cut and paste here. should be just a few lines long
ALSO - THAT IS NOT A STANDARD OC CART PAGE WHAT IS PRECO SEM IVA
YOU HAVE A MODIFIED FILE after INSISTING YOU DO NOT
---------------------------------------------------------
ExTaxCartPrice

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by MateusAMOK » Wed Apr 13, 2022 1:01 am

mikeinterserv wrote:
Wed Apr 13, 2022 12:45 am
OK i in modifications you will see LOG
Find the line that starts with this below cut and paste here. should be just a few lines long
ALSO - THAT IS NOT A STANDARD OC CART PAGE WHAT IS PRECO SEM IVA
YOU HAVE A MODIFIED FILE after INSISTING YOU DO NOT
---------------------------------------------------------
ExTaxCartPrice
preço sem iva its a colum we added to receive the price without tax unlike yours that is both in the same colum, and i said i did modifie the file just not trough the desing editor in the backoffice
----------------------------------------------------------------
MOD: ExTaxCartPrice

FILE: catalog/view/theme/default/template/checkout/cart.twig
CODE: {<td class="text-right"> {{ product.price }}</td>
NOT FOUND - OPERATIONS ABORTED!

FILE: catalog/controller/checkout/cart.php
CODE: 'total' => $total,
LINE: 146
----------------------------------------------------------------

Newbie

Posts

Joined
Mon Apr 11, 2022 11:13 pm

Post by mikeinterserv » Wed Apr 13, 2022 1:06 am

Why it is not finding your twig file line I have no idea. I can see the Ex Tax: is DISPLAYED so that must be the CODE YOU PUT there. There is SOMETHING with your install that is impossible to identify from here and the info you have provided
Last edited by mikeinterserv on Wed Apr 13, 2022 1:10 am, edited 2 times in total.

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by mikeinterserv » Wed Apr 13, 2022 1:09 am

Post you cart TWIG file here as an attachment

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by xxvirusxx » Wed Apr 13, 2022 1:10 am

Because is a typo :)

Before td class is a {
Wrong

Code: Select all

{<td class="text-right"> {{ product.price }}</td>
Correct

Code: Select all

<td class="text-right"> {{ product.price }}</td>
Last edited by xxvirusxx on Wed Apr 13, 2022 1:13 am, edited 1 time in total.

Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România
Who is online

Users browsing this forum: Majestic-12 [Bot] and 67 guests