Jump to content


Welcome to the forum:

Welcome to the iThemes, PluginBuddy and WebDesign.com forum. We've created several tutorial video's to help you get you started with using the forum, please check them out!

Also take note of the forum guidelines.


Support hours:

Our moderators actively respond to forum support requests during normal business hours which are Monday-Friday, 8am - 5pm Central Standard Time, typically within one business day. Although some moderators choose to work during the weekends, we can not guarantee immediate attention to your requests. Thanks for understanding.

What is included with support:

Premium support includes theme/plugin issues such as: bugs encountered under normal operation, how to use basic features, basic WordPress help, and basic help with customization (meaning we point you to resources and will help in more depth as time allows). More information.

Filter To Remove Add To Cart Button

add to cart filter

3 replies to this topic

#1 psillari

psillari

    Member

  • Members
  • Others: BackupBuddy, Exchange - Stripe, Premium Exchange Addon
  • PipPip
  • 19 posts

Posted 20 August 2014 - 12:59 PM

Is there a filter I can use to remove the add to cart button?

Also, can you point me to a list of all the filters available in Exchange if one exists?

Thanks.

Pete

#2 Elise Alley

Elise Alley

    iThemes Support

  • Administrators
  • Others: All Plugins, All Themes, Members, Moderators, Toolkit, Webdesign
  • 5,853 posts
  • LocationOklahoma City, OK

Posted 20 August 2014 - 01:10 PM

Hi Pete,

If you're wanting to remove the Add to Cart button from all of your products, you'd just need to disable the Multi-item Cart add-on in Exchange > Add-ons.

You'll find all the Exchange functions here:  http://ithemes.com/codex/page/Category:Exchange/Functions

Let us know if you have any additional questions.

Thanks,

Elise

#3 psillari

psillari

    Member

  • Members
  • Others: BackupBuddy, Exchange - Stripe, Premium Exchange Addon
  • PipPip
  • 19 posts

Posted 26 August 2014 - 12:14 PM

Elise,

Thanks for the suggestion but I only want to remove the Add to Cart Button from a couple specific pages so that’s why I’m looking for a filter similar to the remove Buy Now filter code
add_filter( 'it_exchange_disable_buy_now', '__return_true' );

Maybe the information I need is contained in the functions list you referenced and I’m just missing the step of how to use, read or interpret the list but I don’t find a function for either “buy now” or “add to cart” for use in filtering.

I was under the impression that you – the developers – added filters and then made them available – at least that’s how I interpreted the http://ithemes.com/forum/topic/60117-super-widget-product-id-filter/#entry253547 post reply.

Is there a list of all the filters?

Does a filter exist for the add to cart button?

Thanks.

Pete

#4 Elise Alley

Elise Alley

    iThemes Support

  • Administrators
  • Others: All Plugins, All Themes, Members, Moderators, Toolkit, Webdesign
  • 5,853 posts
  • LocationOklahoma City, OK

Posted 26 August 2014 - 03:38 PM

Hi Pete,

The link I previously provided shows all Exchange functions, but we do not have a list of every filter available.  If you need to narrow it down farther, you can do so.  For instance, here are all the functions with the cart category:  http://ithemes.com/codex/index.php?title=Category:Exchange/Files/cart.php  

The Recurring Payments add-on does not allow automatically recurring products to be added to a cart.  If you look in the code for that plugin, you'll find code that would help you create something similar:


/**
 * Disables multi item carts if viewing product with auto-renew enabled
 * because you cannot mix auto-renew prices with non-auto-renew prices in
 * payment gateways
 *
 * @since 1.0.0
 * @param bool $allowed Current status of multi-cart being allowed
 * @return bool True or False if multi-cart is allowed
*/
function it_exchange_recurring_payments_multi_item_cart_allowed( $allowed ) {
if ( !$allowed )
return $allowed;

global $post;

if ( it_exchange_is_product( $post ) ) {
$product = it_exchange_get_product( $post );

if ( it_exchange_product_supports_feature( $product->ID, 'recurring-payments', array( 'setting' => 'auto-renew' ) ) )
if ( it_exchange_product_has_feature( $product->ID, 'recurring-payments', array( 'setting' => 'auto-renew' ) ) )
return false; //multi-cart should be disabled if product has auto-renewing feature
}

$cart = it_exchange_get_cart_products();

if ( !empty( $cart ) ) {
foreach( $cart as $product ) {
if ( it_exchange_product_supports_feature( $product['product_id'], 'recurring-payments', array( 'setting' => 'auto-renew' ) ) )
if ( it_exchange_product_has_feature( $product['product_id'], 'recurring-payments', array( 'setting' => 'auto-renew' ) ) )
return false;
}
}

return $allowed;
}
add_filter( 'it_exchange_multi_item_cart_allowed', 'it_exchange_recurring_payments_multi_item_cart_allowed' );

That should at least get you started.

Let us know if you have any other questions.


Thanks,

Elise



Reply to this Topic


ATTENTION
If this topic is marked RESOLVED or INFORMATION, or if you are NOT experiencing EXACTLY the same issue, please start a new topic to provide the details of your problem. If the solution provided doesn't work for you, you should start a new topic. If you feel this thread contains relevant information, you may include a link to it in your new topic. To ensure that we can process your support request efficiently, ALWAYS include a link to your site, and/or the page your request is related to. When posting your question or request on the forum, please be as concise and specific as possible. The shorter and more to the point you can make your request, the better.

For BackupBuddy related issues, be sure to include the status log from your most recent backup.

CLICK HERE to start a new topic in the Exchange ecommerce plugin forum.


  



Also tagged with one or more of these keywords: add to cart, filter

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users