Page 1 of 1

Product Disctouns show Category Page

Posted: Sat May 22, 2021 7:33 am
by opencart-modul
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?

Re: Product Disctouns show Category Page

Posted: Mon May 24, 2021 12:41 am
by rjcalifornia
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?

Re: Product Disctouns show Category Page

Posted: Mon May 24, 2021 7:24 pm
by paulfeakins
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.