mnybud Posted November 11, 2015 Share Posted November 11, 2015 I have limited PHP knowledge and have been fighting with something that is probably not to hard for you PHP freaks so hoping someone can provide me with a solution. Here is what I am trying to accomplish... I have this code that works. <?phpif ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directlyglobal $product;?><?php echo $product->is_in_stock() ? 'in stock' : 'out of stock'; ?> What I am trying to get working is this below but so far I am having no luck figuring it out with my lack of PHP knowledge. More or less I am trying to echo my form which has some other PHP code that breaks it. Can anyone help? Thanks so much in advance! <?phpif ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directlyglobal $product;?> <?php echo $product->is_in_stock() ? ' <?php do_action( 'woocommerce_before_add_to_cart_button' ); ?><form name="order" action="<?php echo esc_url( $product_url ); ?>" method="post"><input type="image" src="image.png" onClick="ga('send', 'event', { eventCategory: 'Button', eventAction: 'click', eventLabel: 'Button'});"/></form><?php do_action( 'woocommerce_after_add_to_cart_button' ); ?> ' : 'out of stock'; ?> Quote Link to comment https://forums.phpfreaks.com/topic/299432-help-with-probably-a-simple-problem/ Share on other sites More sharing options...
Solution mnybud Posted November 11, 2015 Author Solution Share Posted November 11, 2015 never mind I figured it out Quote Link to comment https://forums.phpfreaks.com/topic/299432-help-with-probably-a-simple-problem/#findComment-1526166 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.