You are here:  » Extra button under text Price: 0.00 from store


Extra button under text Price: 0.00 from store

Submitted by wesse249 on Fri, 2015-05-08 14:21 in

Hi David,

I'd like to have an extra button with large text under this field "Price: 0.00 from store" on the productpage with the text "Click here for your price"

Can you tell me how to do this?

Thanks Jan Roel

Submitted by support on Fri, 2015-05-08 16:49

Hello Jan,

Sure, in html/product.php, for distribution 13/03A locate the following code at line 35:

  <?php if (isset($mainProduct["extraHTML"])) print $mainProduct["extraHTML"]; ?>

...and REPLACE with:

  <?php if (isset($mainProduct["extraHTML"])) print $mainProduct["extraHTML"]; ?>
  <a href='<?php print tapestry_buyURL($mainProduct); ?>'>
    <button type='submit'>Click here for your price</button>
  </a>

For the new Responsive HTML template, or distribution 14/06A or later, in the same file locate the following code at line 58:

  <?php if (isset($product_main["extraHTML"])) print $product_main["extraHTML"]; ?>

...and REPLACE with:

  <?php if (isset($product_main["extraHTML"])) print $product_main["extraHTML"]; ?>
  <a href='<?php print tapestry_buyURL($product_main); ?>'>
    <button type='submit'>Click here for your price</button>
  </a>

In both cases, you could also add a style attribute to the button or ideally, add a class attribute and then style accordingly through default.css - let me know if you're not sure of course...

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by wesse249 on Fri, 2015-05-08 18:17

Hello David,

Thanks for your reply. When i click on the butten u go to the following url http://website.nl/jump.php
I don't go to the url of the product.

Gr JR

Submitted by support on Sat, 2015-05-09 08:42

Hello JR,

Sorry about that - just use standard <a> tags around the button, corrected in both modifications above...

Cheers,
David.
--
PriceTapestry.com

Submitted by wesse249 on Mon, 2015-05-25 07:53

Hello David,

Another one: Is it possible to add an extra button with redirection to the advertiser above the product image which only show up when the visitor is watching the productpage with an phone?

Greetings Jan Roel

Submitted by support on Mon, 2015-05-25 08:06

Hello Jan,

Sure - in html/product.php locate the opening of the image container which is at the beginning of line 32 in the distribution:

  <div class='small-8 medium-4 columns'>

...and REPLACE with:

  <div class='small-8 medium-4 columns'>
  <div show-for-small-only>
  <a href='<?php print tapestry_buyURL($product_main); ?>'>
    <button>Click here for your price</button>
  </a>
  </div>

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by Syed on Tue, 2016-01-12 20:45

Hi David,

Instead of price 0.00 and have a button to say check for prices, is it possible to have a condition and not to display the price if it is 0.00?

Something like
If productprice=0.00 then echo"check the store for prices"

Thanks
Syed

Submitted by support on Wed, 2016-01-13 08:47

Hello Syed,

Sure - anywhere that a product record variable is in context - so that would be $product_main throughout html/product.php or $product within the loop in html/prices.php, you could implement an IF condition based on the following example (using $product_main)

  <?php if ($product_main["price"] == "0.00"): ?>
    ...existing code here...
  <?php else: ?>
    <p>Check the store for prices</p>
  <?php endif; ?>

If you wanted to make your alternative text a link to the Buy URL, you could use:

    <p><a href='<?php print tapestry_buyURL($product_main); ?>'>Check the store for prices</a></p>

Hope this helps!

Cheers,
David.
--
PriceTapestry.com