• Posted by NateL 5 months ago.
  • There are 7 posts. The latest reply is from gerrywarner
  • not resolved
  • WordPress version: 2.9
  • WP e-Commerce version: 3.7.6

No tags yet.

The free community support forum is a place where WP e-Commerce users can work with other WP e-Commerce users to help one another get their shops up and running. There is no gaurantee that an Instinct staff member will respond to your topic within the free forum.

Acting out, swearing and threats are not tolerated, please play nice, we are all doing the best we can with the resources available.

 

  1. NateL
    New Member

    I have a client that is selling some big items and would rather have customers call to order out of a specific category.

    In other words, when a customer is browsing this specific category, instead of a price or an "Add to Cart" button, there's a link that says "Call to order"

    Any ideas on how I could do this?

    Posted 5 months ago #

  2. bghouse
    New Member

    I have some ideas to point you in a direction at least... I've only started working with the code this weekend, but it's pretty straight forward.

    You'll want to do a check for if browsing a specific category, then write an if / else to change the button. Depending on whether you have a button image, or if you are still using the TXT variables.

    If using the TXT variables with a background images, then you'll want to go to the languages first and define a new variable to use that says "Call to Order".

    Then, you'll write you're if to choose between something like
    <input type="submit" value="<?php echo TXT_WPSC_ADDTOCART; ?>" name="Buy" class="wpsc_buy_button" id="product_<?php echo wpsc_the_product_id(); ?>_submit_button"/>
    -OR-
    <input type="submit" value="<?php echo TXT_WPSC_CALLTOORDER; ?>" name="Buy" class="wpsc_buy_button" id="product_<?php echo wpsc_the_product_id(); ?>_submit_button"/>

    Your If / Else will be something like:

    <?php if(wpsc_is_in_category('10')) : ?>

    And I think you'll have to do this in both the products_page.php and the single_product.php.

    Hopefully that gets you started.

    Posted 5 months ago #

  3. Ravensrock
    New Member

    Hi bghouse,

    Are you able to explain in more detail how to do this. PHP code is not my strong point.
    This is what i'm need to do.

    Thanks

    Posted 5 months ago #

  4. Ravensrock
    New Member

    Hi,

    I got a friend of a friend to code this up so below is the code. I works for me so thought you may want it. It's not these same as what you are looking for but if any price on your site is 0.00 it will display the 'Call for Price'.

    J

    What i did was replaced this code with the below code in both the grid_view.php and the single_product.php in the theme i was using. These files were replaced on the sever in the /wp-content/uploads/wpsc/themes/ (your themes folder)

    <span id="product_price_<?php echo wpsc_the_product_id(); ?>" <span class="price_display"><?php echo wpsc_the_product_price(); ?></span>

    New code

    <?php if(preg_match('/[^0-9](0.00)$/', wpsc_product_normal_price())): ?>
    <span class="special">Call for price</span>
    <?php else: ?>
    <span class="price_display"><?php echo wpsc_product_normal_price() ?></span>
    <?php endif ?>

    Posted 5 months ago #

  5. John Doe
    New Member

    Wow this is exactly what I was looking for as well!

    Thanks Ravensrock

    Cheers

    Kelton

    Posted 5 months ago #

  6. NateL
    New Member

    Thanks for the replies on this :)

    Posted 5 months ago #

  7. gerrywarner
    New Member

    Just wanted to say thanks too - I had some events which were free and this solved an aesthetic headache

    Posted 1 month ago #

RSS feed for this topic

Reply

You must log in to post.