B
B
Boris Belov2015-09-01 08:22:10
PHP
Boris Belov, 2015-09-01 08:22:10

How to make in OPENCART so that when you click on a product, they fall into a category?

Good morning.
Faced a problem, and the desire of the customer.
There is a site .
If you scroll down a little, you will see "PROMOTIONS IN RETAIL STORE" "PROMOTIONS IN INTERNET STORES" "PROMOTIONS IN SALON / SPA".
1f724854b4794db5ac720eae98887e71.jpg
So we need to make it so that when we click on the "share" we do not get into the "share" but into the category, with all the shares.
By promotions, I mean a product (in Opencart, in this template, promotions are created through a product)
Who knows how to solve the issue?
-----------
Here is the line when responsible for display and link.

<div id="carousel-<?php echo $module; ?>-<?php echo $index; ?>" class="owl-carousel tab-content box-content">
        <?php foreach ($section['items'] as $product) { ?>
        <div class="product-grid-item display-<?php echo $this->journal2->settings->get('product_grid_wishlist_icon_display');?> <?php echo $this->journal2->settings->get('product_grid_button_block_button');?> <?php echo $product['classes']; ?>">
            <div class="product-wrapper" style="<?php echo $image_bgcolor; ?>">
                <?php if (isset($product['thumb'])) { ?>
                <div class="image">
                    <a href="<?php echo $product['href']; ?>" <?php if(isset($product['thumb2']) && $product['thumb2']): ?> class="has-second-image" style="<?php echo $image_border_css; ?>;background: url('<?php echo $product['thumb2']; ?>') no-repeat;" <?php else: echo $image_border_css; endif; ?>>
                        <img class="lazyOwl first-image" width="<?php echo $image_width; ?>" height="<?php echo $image_height; ?>" src="<?php echo $dummy_image; ?>" data-src="<?php echo $product['thumb']; ?>" title="<?php echo $product['name']; ?>" alt="<?php echo $product['name']; ?>" />
                    </a>

In this case, it
<?php echo $product['href']; ?>
should be replaced <?php echo $product['href']; ?>with some (?) parameter that would be responsible for the category in which this product is located.
-----
RESOLVED!
A very sophisticated way, but effective.
1. Go to carousel-product.tpl or another template in which we are displaying products, and to which we need to put links of their categories. change the values <?php echo $product['href']; ?>​​​​to <?php echo $product['description']; ?>
2. because. Opencart does not allow you to pull the link in any way, then we do it ourselves. In the code, we registered the possibility of displaying a "description" instead of a link, that is, we go to the "description" of our product.
4fafab5d06c349e49c33b675a882faca.jpg
And we get
a48dc762620849cd84ffd661b5be88f2.jpg
---
FIXED 2.0
Change <?php echo $product['href']; ?>to <?php echo $product['name']; ?>. We change the title of our promotion to a link.
because in my task there will be no detailed page of the promotion, but only getting into categories, then this title does not particularly play a role for promotion.
----
Solved On the
main page, the Carousel contains two dots ".."
php

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
sasha, 2015-09-01
@madmages

your shares are made in the form of commodities. Opencart has a standard CNC link conversion mechanism. Because of this mechanism, you will not be able to just do what you want without breaking anything along the way. And the fact that you want it straight away correcting in one - five places will not work

S
sbh, 2015-09-01
@sbh

Tell me, do you have a paid template? Just wonderful in my opinion.

B
Boris Belov, 2015-09-01
@iborisbelov

RESOLVED!
A very sophisticated way, but effective.
1. Go to carousel-product.tpl or another template in which we are displaying products, and to which we need to put links of their categories. change the values <?php echo $product['href']; ?>​​​​to <?php echo $product['description']; ?>
2. because. Opencart does not allow you to pull the link in any way, then we do it ourselves. In the code, we registered the possibility of displaying a "description" instead of a link, that is, we go to the "description" of our product.
And we get
a48dc762620849cd84ffd661b5be88f2.jpg

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question