Author Topic: "Click For Price"  (Read 1746 times)

32golf

  • Jr. Member
  • **
  • Posts: 68
"Click For Price"
« on: March 10, 2011, 13:10:19 pm »
Hi Guys,
ive had a look on these forums but cant seem to find anything along these lines so here it goes...

A company im making a website for need to have a "click for price" link on some of there products for legal reasons. Is there any way i can do this in VirtuMart?

Thankyou,
32golf

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10277
  • VirtueMart Version: 3+
Re: "Click For Price"
« Reply #1 on: March 10, 2011, 13:31:59 pm »
ofcourse

you are just going to have to use ajax/java around the price div

I do NOT do development work for hire.

32golf

  • Jr. Member
  • **
  • Posts: 68
Re: "Click For Price"
« Reply #2 on: March 10, 2011, 13:46:22 pm »
im quite new to this could you explain in a bit more detail


sorry to be a pain

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10277
  • VirtueMart Version: 3+
Re: "Click For Price"
« Reply #3 on: March 10, 2011, 14:22:15 pm »
I am not a java coder. But this can be done with a little javascript

I do NOT do development work for hire.

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10277
  • VirtueMart Version: 3+
Re: "Click For Price"
« Reply #4 on: March 10, 2011, 14:28:37 pm »
this might work


<script>
function show_text(div_id,text){
 document.getElementById(div_id).innerHTML = text
// you can also use .innerText but then no HTML inserted in the div will be parsed.
}
<script>


<div id="1"></div>
<a href="#" onClick="show_text('div_1','<b><?php echo $product_price ?></b>')">Show Price</a>
<div id="div_1"></div>
I do NOT do development work for hire.

32golf

  • Jr. Member
  • **
  • Posts: 68
Re: "Click For Price"
« Reply #5 on: March 10, 2011, 18:53:02 pm »
Really appreciate your help BanquetTables.pro
where do i add this because it would only be for certain products and not the entire catalog

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10277
  • VirtueMart Version: 3+
Re: "Click For Price"
« Reply #6 on: March 10, 2011, 19:08:11 pm »
the script has to be in the head of your template.


THEN, the code will have to be in a flypage template.

do these products mix in with categories with products that do not have the requirement?
I do NOT do development work for hire.

32golf

  • Jr. Member
  • **
  • Posts: 68
Re: "Click For Price"
« Reply #7 on: March 10, 2011, 19:37:08 pm »
yes unfortunately.

basically, Taylormade (golf club maker) have funny rules about displaying products online. Ping (another maker)wont even allow you to advertise a price anywhere, you have to ring up or email for a price.

i was thinking possibly having a checkbox which says "display price" and if its left unchecked, it says "click for price" on the product.



PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10277
  • VirtueMart Version: 3+
Re: "Click For Price"
« Reply #8 on: March 10, 2011, 20:50:25 pm »
You are going to need a coder to do this for you
I do NOT do development work for hire.

32golf

  • Jr. Member
  • **
  • Posts: 68
Re: "Click For Price"
« Reply #9 on: March 10, 2011, 22:00:04 pm »
actually thinking about it - it would be ok to have the "Taylormade" category set to the Click For Price. Because the Ping category can just set the price as £0.00 and it will auto set it as email for price wouldnt it?

so how could i use that code to just set it for the Taylormade cat?