Hello,
I have been trying to think on a particular thought, if i could restrict my clients to some particular number of products that they could add. Once they are reaching the same, maybe a notification or a bar showing the number or products added.
Is this possible.
I have been trying to think on a particular thought, if i could restrict my clients to some particular number of products that they could add. Once they are reaching the same, maybe a notification or a bar showing the number or products added.
Is this possible.
Ah, got it. It would probably be easiest to just hide the "Insert" button when there are a certain number of products. You should be able to do it with something like this:
Replace "20" with whatever number you need.
Code: Select all
IN:
/admin/view/template/catalog/product_list.tpl
REPLACE:
<a onclick="location = '<?php echo $insert; ?>'" class="button"><?php echo $button_insert; ?></a>
WITH:
<?php $this->load->model('catalog/product'); if ($this->model_catalog_product->getTotalProducts() <= 20) { ?>
<a onclick="location = '<?php echo $insert; ?>'" class="button"><?php echo $button_insert; ?></a>
<?php } ?>
Hello,
Yes this would be a easy way on this. A more practical approach it is. Thanks for this. However as a customer when I think, suppose if we were to forget that this setting is done. Then it could be mistaken for an error. I suggest a small thing as well to add up. A count of products added beside the insert button. Hence when I see 20 of 20 shown then, then any layman would understand the limit is set.
Any idea on what code we need to set in to show the counter of added products to the number of allowed products. What's your opinion.
Do let me know if this can be done.
Yes this would be a easy way on this. A more practical approach it is. Thanks for this. However as a customer when I think, suppose if we were to forget that this setting is done. Then it could be mistaken for an error. I suggest a small thing as well to add up. A count of products added beside the insert button. Hence when I see 20 of 20 shown then, then any layman would understand the limit is set.
Any idea on what code we need to set in to show the counter of added products to the number of allowed products. What's your opinion.
Do let me know if this can be done.
Thanks for ur answer.. However I am not a programmer bro.. Just a designer. Till now was just designing and integrating the cart. However had a peculiar request and I was stuck. Is it possible for you to tell me what could be the code. And also let me know ur skype I'd. Maybe customization projects I could send it across. What say. Could u help me with this for now.
I was looking for the same thing. Based on the comments in this thread I made an vqmod extension:
http://www.opencart.com/index.php?route ... on_id=5973
http://www.opencart.com/index.php?route ... on_id=5973
I have problem to make work this in opencart 3.0.20 , I need your help, thanks!
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<modification>
<file path="admin/controller/catalog/product.php">
<operation>
<search><![CDATA[
$product_total = $this->model_catalog_product->getTotalProducts($filter_data);
]]></search>
<add position="after"><![CDATA[
$data['br_produkti'] = $this->model_catalog_product->getTotalProducts($filter_data);
]]></add>
</operation>
</file>
<file path="admin/view/template/catalog/product_list.twig">
<operation>
<search><![CDATA[
<a href="{{ add }}" data-toggle="tooltip" title="{{ button_add }}" class="btn btn-primary"><i class="fa fa-plus"></i></a>
]]></search>
<add position="replace"><![CDATA[
<?php if ($br_produkti<a href="{{ add }}" data-toggle="tooltip" title="{{ button_add }}" class="btn btn-primary"><i class="fa fa-plus"></i></a>
]]></add>
</operation>
</file>
</modification>
Who is online
Users browsing this forum: Semrush [Bot] and 25 guests