Author Topic: Replace notify button with add to cart  (Read 5418 times)

Forrest

  • Full Member
  • ***
  • Posts: 1972
  • Me and my baby
    • Web Developer
Re: Replace notify button with add to cart
« Reply #15 on: March 21, 2010, 10:29:57 am »
Ooops, edit:

components/com_virtuemart/themes/default/templates/common/availability.tpl.php.

You will see a few php functions (pretty obvious what does what). Edit accordingly. this would be a better place to edit your Stock words size as well, rather than my previous post's styling.

nuller-joe

  • Beginner
  • *
  • Posts: 46
Re: Replace notify button with add to cart
« Reply #16 on: March 21, 2010, 10:41:52 am »
Im confused right now... You gotta specify it even more ^^
As i said before, i need some kind of check stock so the custommer can see how manys theres left, but they still need to be able to buy a product out of stock

Forrest

  • Full Member
  • ***
  • Posts: 1972
  • Me and my baby
    • Web Developer
Re: Replace notify button with add to cart
« Reply #17 on: March 21, 2010, 10:56:08 am »
1. Make sure this is in your browse template:

           <?php
           if( $this->get_cfg( 'showAvailability' )) {
              echo $product_availability;
           }
           ?>


2. Edit your:
components/com_virtuemart/themes/default/templates/common/availability.tpl.php.

replace code:
   elseif( ($product_in_stock >= 1 && CHECK_STOCK) ) {

with this code:
   else  {


3. You can keep check stock turned off.

nuller-joe

  • Beginner
  • *
  • Posts: 46
Re: Replace notify button with add to cart
« Reply #18 on: March 21, 2010, 11:30:09 am »
It works now, THANK YOU, I am eternally grateful to you ^^
Last question, if i want some text like "in stock: 0, expected delivery date xx, where should that be written?

Forrest

  • Full Member
  • ***
  • Posts: 1972
  • Me and my baby
    • Web Developer
Re: Replace notify button with add to cart
« Reply #19 on: March 21, 2010, 11:32:35 am »
components/com_virtuemart/themes/default/templates/common/availability.tpl.php

Within the statement you just edited!

nuller-joe

  • Beginner
  • *
  • Posts: 46
Re: Replace notify button with add to cart
« Reply #20 on: March 21, 2010, 11:38:12 am »
But im not able to make different "text messages" to different stock status? so if >1 "delivry date 12 days" and <1 "delivery date 2 days"?

nuller-joe

  • Beginner
  • *
  • Posts: 46
Re: Replace notify button with add to cart
« Reply #21 on: March 21, 2010, 13:11:31 pm »
And i just saw another problem -.-
If theres 0 in stock, and i buy one of them, the stock will change to -1..

Forrest

  • Full Member
  • ***
  • Posts: 1972
  • Me and my baby
    • Web Developer
Re: Replace notify button with add to cart
« Reply #22 on: March 22, 2010, 07:39:44 am »
?? You can do what ever you want!

Maybe you don't want to show negative numbers and give different messages based on stock, so:

   if ($product_in_stock <= 0) {
     echo 'Products in Stock: 0';
     echo 'delivery date 12 days';
   } else { ?>
   <span style="font-weight:bold;">
         <?php echo $VM_LANG->_('PHPSHOP_PRODUCT_FORM_IN_STOCK') ?>:
        </span><?php echo $product_in_stock ?>
        <br /><br />
   <?php  echo 'delivery date 2 days';
   }


My recommendation is you read up on a little php. This is very basic php you are asking about, and can be learned quickly so you can achieve the outcomes you want! good luck!

nuller-joe

  • Beginner
  • *
  • Posts: 46
Re: Replace notify button with add to cart
« Reply #23 on: March 22, 2010, 16:09:05 pm »
Yeah i know, i will start learning some php soon, i just needed to finish my shop right now :)
I really appreciate your help. I have 3 other minor problems, i dont think it will take long time to fix. Is there any chance you could add me to msn, only if you have the time to help me. If it takes long time, you'll be paid :)

My msn: adamengsig@ofir.dk