Post by opencart-modul » Sat May 22, 2021 7:33 am

products discount prices - show category page.

catalog/controller/product/category.php
find

Code: Select all

=> $image,
add after

Code: Select all

'discounts'   => $discounts,
find

Code: Select all

$data['products'][] = array(
add before

Code: Select all

 $discounts_data = $this->model_catalog_product->getProductDiscounts($result['product_id']);
              $discounts = array();
              foreach ($discounts_data as $discount) {
                $discounts[] = array(
                  'quantity' => $discount['quantity'],
                  'price'    => $this->currency->format($this->tax->calculate($discount['price'],  $result['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']));
              }     
catalog/view/theme/default/template/product/category.twig
find

Code: Select all

  {% if product.rating %}
add before

Code: Select all

{% if product.discounts %}
  <ul class="list-unstyled">
 {% for product.discounts in discount %}
 <li>{{ discount.quantity }} - {{ discount.price }}</li>
{% endfor %}
 </ul>
{% endif %}
where is the wrong?


Posts

Joined
Wed Jan 20, 2021 7:26 am

Post by rjcalifornia » Mon May 24, 2021 12:41 am

opencart-modul wrote:
Sat May 22, 2021 7:33 am
products discount prices - show category page.

catalog/controller/product/category.php
find

Code: Select all

=> $image,
add after

Code: Select all

'discounts'   => $discounts,
find

Code: Select all

$data['products'][] = array(
add before

Code: Select all

 $discounts_data = $this->model_catalog_product->getProductDiscounts($result['product_id']);
              $discounts = array();
              foreach ($discounts_data as $discount) {
                $discounts[] = array(
                  'quantity' => $discount['quantity'],
                  'price'    => $this->currency->format($this->tax->calculate($discount['price'],  $result['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']));
              }     
catalog/view/theme/default/template/product/category.twig
find

Code: Select all

  {% if product.rating %}
add before

Code: Select all

{% if product.discounts %}
  <ul class="list-unstyled">
 {% for product.discounts in discount %}
 <li>{{ discount.quantity }} - {{ discount.price }}</li>
{% endfor %}
 </ul>
{% endif %}
where is the wrong?
What exaclty is the problem?

Image
A2 Hosting features: Shared Turbo Boost, Managed Warp 1, Unmanaged Hyper 1, and Warp 2 Turbo


Active Member

Posts

Joined
Fri Sep 02, 2011 1:19 pm
Location - Worldwide

Post by paulfeakins » Mon May 24, 2021 7:24 pm

opencart-modul wrote:
Sat May 22, 2021 7:33 am
where is the wrong?
Free work request.

I suggest you pay a developer such as ourselves or post a job in the Commercial Support Forum.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom
Who is online

Users browsing this forum: DigitCart and 104 guests