gplsaver on "[Plugin: Woo-RFQ for WooCommerce] Hide Add to Cart/Quote Button on product catergory page"

ساخت وبلاگ

simonph79
Member
Posted 13 hours ago #

Hi there,

Firstly I would like to say your plugin has answered a question I've been trying to answer for some time.

I'd like to hide the Add to Cart/Quote button on product catergory pages but not on individual product pages.

Is this possible at all?

Eaxmaple URL:
http://renshawstone.com.au/product-category/edges-and-finishes/

But would like to keep it for individual products as per the example below:
http://renshawstone.com.au/online-calculator/draining-grooves/

I am working on a calculator for a client and if I can get this sorted I will be almost there.

I have investigated CSS mods but cant seem to find the right options.

Thanks in advance for your help.

Cheers.

Simon

https://wordpress.org/plugins/woo-rfq-for-woocommerce/

simonph79
Member
Posted 13 hours ago #

Sorry running WordPress 4.5.1 and the latest version of Woo-RFQ

gplsaver
Member
Plugin Author

Posted 10 hours ago #

Simon,
Are these product categories on the page below or are they variable products?
http://renshawstone.com.au/product-category/edges-and-finishes/

simonph79
Member
Posted 10 hours ago #

gplsaver
Member
Plugin Author

Posted 10 hours ago #

What happens if you make the products variable products and on this page
http://renshawstone.com.au/online-calculator/draining-grooves/ make "length_needed" a default of 1.

Also i noticed that even when you clear the rfq cart the buttons are still showing in cart. I am not sure if this is a bug in the plugin by me. i can't reproduce here.

gplsaver
Member
Plugin Author

Posted 10 hours ago #

They are variable in a sense since they are priced by length

simonph79
Member
Posted 10 hours ago #

Yes OK that makes sense.

I am not seeing where I enter the length needed as a default of 1 however.

My biggest challenge is that I am seeing add to quote and select options buttons. hence i want to hide the add to quote button on the product category pages but not on individual items.

gplsaver
Member
Plugin Author

Posted 10 hours ago #

I think if you make the products variable you will not the see add to quote button. see if we can solve that problem first and we will see about the default of 1.

simonph79
Member
Posted 10 hours ago #

I have now seen the in quote issue once I remove items, but it does allow me to re-add and does not duplicate.

gplsaver
Member
Plugin Author

Posted 10 hours ago #

I think you need the "select options" button since that is the only way they can get to the product to enter the variable length.

gplsaver
Member
Plugin Author

Posted 9 hours ago #

if you just don't want to see any buttons on the archive page then do the following i will give you on the next post. stay tuned

simonph79
Member
Posted 9 hours ago #

Great thanks.

We do need to keep the Select Options button for sure. But we can also click the product image which takes us to the options anyway.

But if we can leave Select Option and hide add to quote that would be great.

gplsaver
Member
Plugin Author

Posted 8 hours ago #

This is what I got for you based on two pages you gave me. Hope it works

add_filter('gpls_woo_rfq_in_rfq_text', 'gpls_woo_rfq_request_quote_text_mod',1000,1);
add_filter('gpls_woo_rfq_request_quote_text', 'gpls_woo_rfq_request_quote_text_mod',1000,1);
function gpls_woo_rfq_request_quote_text_mod($request_quote)
{ $url = $_SERVER["REQUEST_URI"]; $Hide = strpos($url, 'shop'); if ($Hide!==false) { $request_quote=""; } $css='<style type="text/css">.woocommerce ul.products li.product .button { display: none;}.add_to_cart_button {display: block !important;} </style>'; echo $css; retu $request_quote;
}
function gpls_woo_rfq_Hide_Add_To_Quote() { $css='<style type="text/css">.woocommerce ul.products li.product .button { display: none;}.add_to_cart_button {display: block !important;} </style>'; echo $css;
}

gplsaver
Member
Plugin Author

Posted 8 hours ago #

sorry change 'shop' above to 'product-category' or 'edges-and-finishes'
depending on what you are doing. probably 'edges-and-finishes'

gplsaver
Member
Plugin Author

Posted 8 hours ago #

hope this works

gplsaver
Member
Plugin Author

Posted 8 hours ago #

here again with corrections

add_filter('gpls_woo_rfq_in_rfq_text', 'gpls_woo_rfq_request_quote_text_mod',1000,1);
add_filter('gpls_woo_rfq_request_quote_text', 'gpls_woo_rfq_request_quote_text_mod',1000,1);
function gpls_woo_rfq_request_quote_text_mod($request_quote)
{ $url = $_SERVER["REQUEST_URI"]; $Hide = strpos($url, 'edges-and-finishes'); if ($Hide!==false) { $request_quote=""; } $css='<style type="text/css">.woocommerce ul.products li.product .button { display: none;}.add_to_cart_button {display: block !important;} </style>'; add_action( 'wp_print_styles', 'gpls_woo_rfq_Hide_Add_To_Quote' ); echo $css; retu $request_quote;
}
function gpls_woo_rfq_Hide_Add_To_Quote() { $css='<style type="text/css">.woocommerce ul.products li.product .button { display: none;}.add_to_cart_button {display: block !important;} </style>'; echo $css;
}

gplsaver
Member
Plugin Author

Posted 5 hours ago #

let me know if it works :)

simonph79
Member
Posted 6 minutes ago #

Hi there,

Sorry for the delayed response.

I have added the code you kindly provided above and when i do some of the text tus red and is removed when I click save stylesheet in the CSS editor.

Link to a screen shot below.

http://renshawstone.com.au/wp-content/uploads/2016/04/CSS-Snippet.png

Can I confirm the code your provided was meant to be applied in the CSS editor? Silly question I know.

But because the red text in the code is removed the change has not worked as yet.

Cheers.

Simon

gplsaver
Member
Plugin Author

Posted 10 seconds ago #

sorry. I should have been more clear

Add this code to the bottom of your functions.php in your theme directory

add_filter('gpls_woo_rfq_in_rfq_text', 'gpls_woo_rfq_request_quote_text_mod',1000,1);
add_filter('gpls_woo_rfq_request_quote_text', 'gpls_woo_rfq_request_quote_text_mod',1000,1);
function gpls_woo_rfq_request_quote_text_mod($request_quote)
{ $url = $_SERVER["REQUEST_URI"]; $Hide = strpos($url, 'product-category'); if ($Hide!==false) { $request_quote=""; } $css='<style type="text/css">.woocommerce ul.products li.product .button { display: none;}.add_to_cart_button {display: block !important;} </style>'; add_action( 'wp_print_styles', 'gpls_woo_rfq_Hide_Add_To_Quote' ); echo $css; retu $request_quote;
}
function gpls_woo_rfq_Hide_Add_To_Quote() { $css='<style type="text/css">.woocommerce ul.products li.product .button { display: none;}.add_to_cart_button {display: block !important;} </style>'; echo $css;
}

WordPress ...
ما را در سایت WordPress دنبال می کنید

برچسب : نویسنده : استخدام کار wpss بازدید : 109 تاريخ : جمعه 10 ارديبهشت 1395 ساعت: 6:58