Hi All
I'm currently building a full online shop for trade customers only, so it shows all prices as ex VAT but I also wish to include the inc VAT price too for those not VAT registered.
I've got it to work perfectly on a single product page but am having problems displaying it on a product list page, this is what I've got so far to display the product listing...
Code
- perch_shop_products([
- 'category' => 'products/'.perch_get('path').'/',
- 'template' => 'products/list-category.html',
- 'each' => function($item) {
- $item['incVAT'] = perch_shop_products([
- 'template' => 'products/ex_vat.html',
- $VAT = '1.20',
- $incVAT = number_format($exVAT * $VAT, 2),
- ], true);
- return $item;
- },
- ]);
...this is basically listing all the ex VAT prices for all products in one string... £6.255.757.506.256.257.506.255.655.9997.993.4946.997.958.35 inc VAT.
Any help to get this to work out the inc VAT price for each product individually would be much appreciated.
Glen