Jump to content

Recommended Posts

A simple add-on to let you display buy button on product info page. This button will change if stock is zero and prevent the product from being added to cart.

Again totally standalone with no core code change. Simply copy all files into relevant sections and go to admin modules /content and install.

 

image.png.3eebee7c27da4d80afeb0ea3430c40cd.png

 


 

Share this post


Link to post
Share on other sites

Wonderful Zahid !!!

This addon is very demanded by the users of the community. I try it and it works impeccable !!!

Great job, and many thanks for your support of the project and the community.

I will upload the Spanish version later (if you allow me).

Best regards.

Valqui

 

Share this post


Link to post
Share on other sites

You definetely should not show free shipping if a product is out of stock.

It confuses customers to the extend that they will leave your site.


Not too experienced, but very willing to learn.

Share this post


Link to post
Share on other sites
Posted (edited)

😊 Not all customers are as fickle as you think. Also it's a test site not a live shop? You know just to demonstrate.

Anyway stock or no stock if you offer free shipping it's a bonus why not tell the customer.

Edited by JcMagpie

 

Share this post


Link to post
Share on other sites

Ok I got JcM Product listing No Stock Buy Button V1.0 CE working as a Pre-Order button so customer knows the item is out of stock but can pre-order it for when the next container shipment arrives.

But having a small issue with this one, so edited public_html/includes/modules/content/product_info/templates/tpl_cm_pi_jcm_buy_button.php
to read
   } else {
// Show red button with pre-order and allow purchase
            echo tep_draw_button(MODULE_CONTENT_PI_JCM_BUY_BUTTON_TEXT2, 'fa fa-shopping-cart', null, 'primary', array('params' => 'data-has-attributes="' . (($products_attributes['total'] > 0) ? '1' : '0') . '" data-in-stock="' . (int)$product_info['products_quantity'] . '" data-product-id="' . (int)$product_info['products_id'] . '"'), 'btn-success btn-block btn-lg btn-product-info btn-buy m-2');

I can click on the button while btn-success is there which makes the button green but when I change it to btn-danger and hover over the button I get the circle with a cross threw it and can't click

Share this post


Link to post
Share on other sites
Posted (edited)

Do you have any other nostock installed? That sounds like the js script used in JcM buy button. Look in buy button template file for

/public_html/includes/modules/content/product_info/templates/tpl_cm_pi_jcm_buy_button.php

<script>
     $('.btn-danger').prop("disabled", true).click(function() {
  console.log('nnn');
})
 </script>

and remove or comment out. Also may have to remove fas fa-ban or fa-fa-ban

😊  When you make mod's to an add-on to use it for somthing else you have to look at all the functions it is using and edit or remove as required.

 

Edited by JcMagpie

 

Share this post


Link to post
Share on other sites

Nope, fresh install
The file tpl_cm_pi_jcm_buy_button.php is in the templates director of
JcM Product info No stock buy button V1.0\includes\modules\content\product_info\templates
So I hope I have installed the right software

Changed to
<script>
     $('.btn-danger').prop("disabled", false).click(function() {
  console.log('nnn');
})
 </script>

And all working now

One last question before I head to bed...
Do you have a recommendation of a app / module that will list all produces with a stock level of 0 or less and allow the stock level to be easily adjusted
Or even at the most basic just the stock level report of item with 0 and less

 

 

Share this post


Link to post
Share on other sites
Posted (edited)
17 minutes ago, supercheaphobb said:

One last question before I head to bed...

No not sure about that but this is a good one to make stock updates more bearable, you can select my manufacturer or cat's and make changes and update .

Quick update BS

Alternativly you could run a simple SQL script in phpAdmin. I'm sure one of the db experts will be able to help.

Something like this, Backup first and only run simulation to test first.

We look in products for all product with zero quantity and chage it to 20.

UPDATE `products` SET `products_quantity` = REPLACE(`products_quantity`, "0", "20");

 

Edited by JcMagpie

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×