• So I posted earlier with a POST 500 error that I resolved but it didn’t fix the initial problem I had which is that items do not add to cart. The URL’s propogate fine in the source code but when I click the Add To Cart button, nothing happens.

    This all happened when we updated to WordPress 4.4.2 and WooCommerce 2.5.5 we were using 3.8 and 2.2.10

    Here’s my WooCommerce system status. I know it’s some sort of theme coding issue but I’ve gone through every piece of our code for cart functionality via ajax and nothing is out of place. Help!

    There are outdated templates in there but I had already updated them and it did not fix the issue. Unless I didn’t do it right.

    ### WordPress Environment ###
    
    Home URL: http://adr.dev
    Site URL: http://adr.dev
    WC Version: 2.5.5
    Log Directory Writable: ✔
    WP Version: 4.4.2
    WP Multisite: –
    WP Memory Limit: 1 GB
    WP Debug Mode: ✔
    Language: en_US
    
    ### Server Environment ###
    
    Server Info: nginx/1.4.6
    PHP Version: 5.5.9-1ubuntu4.14
    PHP Post Max Size: 8 MB
    PHP Time Limit: 1000000
    PHP Max Input Vars: 1000
    SUHOSIN Installed: –
    MySQL Version: 5.5.47
    Max Upload Size: 2 MB
    Default Timezone is UTC: ✔
    fsockopen/cURL: ✔
    SoapClient: ✔
    DOMDocument: ✔
    GZip: ✔
    Multibyte String: ✔
    Remote Post: ✔
    Remote Get: ✔
    
    ### Database ###
    
    WC Database Version: 2.5.5
    :
    woocommerce_sessions: ✔
    woocommerce_api_keys: ✔
    woocommerce_attribute_taxonomies: ✔
    woocommerce_termmeta: ✔
    woocommerce_downloadable_product_permissions: ✔
    woocommerce_order_items: ✔
    woocommerce_order_itemmeta: ✔
    woocommerce_tax_rates: ✔
    woocommerce_tax_rate_locations: ✔
    
    ### Active Plugins (44) ###
    
    License-Manager: by Isaac Oyelowo – 4.8
    Akismet: by Automattic – 3.1.8
    Audio player: by Martin Laine – 2.0.4.6
    Autoptimize: by Frank Goossens (futtta) – 2.0.2
    Black Studio TinyMCE Widget: by Black Studio – 2.2.8
    ADS PRO – Multi-Purpose WordPress Ad Manager: by Scripteo – 2.1.0
    Categories Images: by Muhammad Said El Zahlan – 200.4.2
    Category Wise Search Widget: by Shambhu Prasad Patnaik – 1.3
    Contact Form 7: by Takayuki Miyoshi – 4.4
    Truemag - Member: by Cactusthemes – 2.6
    Display Widgets: by Strategy11 – 2.05
    Disqus Comment System: by Disqus  – 2.84
    Force Plugin Updates Check: by Pippin Williamson – 1.0.1
    gap-hub-user-role.: by ay@gaphub – 3.4.1
    HM Dev: by Human Made Limited – 1.3
    WPBakery Visual Composer: by Michael M - WPBakery.com – 4.4.2
    JW Player 6 Plugin for WordPress: by LongTail Video Inc. – 2.1.10
    KingSumo Giveaways: by KingSumo – 1.3.2
    Per page head: by Erik von Asmuth – 1.3
    Soundcloud is Gold: by Thomas Michalak – 2.3.2
    SumoMe: by SumoMe – 1.10
    Compress JPEG & PNG images: by TinyPNG – 1.7.0
    TrueMAG - Movie: by Cactusthemes – 3.1.1
    TrueMAG Rating: by Cactusthemes – 2.13
    TrueMAG - Shortcodes: by Cactusthemes – 3.1.2
    Toolset Types: by OnTheGoSystems – 1.9.1
    Video Thumbnails: by Sutherland Boswell – 2.12.1
    W3 Total Cache: by Frederick Townes – 0.9.4.1
    WooCommerce 2Checkout Gateway: by Krokedil – 1.3.9
    WooCommerce Braintree Gateway: by WooThemes / SkyVerge – 3.1.2 – 3.2.0 is available
    WooCommerce Google Analytics Integration: by WooThemes – 1.4.0
    WooCommerce Product Archive Customiser: by jameskoster – 0.5.1
    WooCommerce Product Vendors: by WooThemes – 100.1.8
    WooCommerce Quick Export Plugin: by MB Création – 2.1.2
    WooCommerce Amazon S3 Downloads: by NuclearThemes – 1.4
    WooCommerce: by WooThemes – 2.5.5
    Yoast SEO: by Team Yoast – 3.1.2
    WP Favorite Posts: by Huseyin Berberoglu – 1.6.6
    WP Open Graph: by Nick Yurov – 1.5
    WP-PageNavi: by Lester 'GaMerZ' Chan – 2.89.1
    wpMandrill: by Mandrill – 1.33
    Yoast WooCommerce SEO: by Joost de Valk – 1.1.2
    YITH WooCommerce Wishlist: by Yithemes – 2.0.14
    Yotpo Social Reviews for Woocommerce: by Yotpo – 1.1.4
    
    ### Settings ###
    
    Force SSL: ✔
    Currency: USD ($)
    Currency Position: left
    Thousand Separator: ,
    Decimal Separator: .
    Number of Decimals: 2
    
    ### API ###
    
    API Enabled: ✔
    API Version: 3.1.0
    
    ### WC Pages ###
    
    Shop Base: #3278 - /shop/
    Cart: #3279 - /cart/
    Checkout: #3280 - /checkout/
    My Account: #3281 - /my-account/
    
    ### Taxonomies ###
    
    Product Types: external (external)
    grouped (grouped)
    simple (simple)
    standard (standard-2)
    variable (variable)
    
    ### Theme ###
    
    Name: truemag child theme
    Version: 1.0.0
    Author URL:
    Child Theme: ✔
    Parent Theme Name: truemag
    Parent Theme Version: 4.2.7
    Parent Theme Author URL: http://themeforest.net/user/cactusthemes
    WooCommerce Support: ✔
    
    ### Templates ###
    
    Overrides: truemag-child/woocommerce/archive-product.php version - is out of date. The core version is 2.0.0
    truemag/woocommerce/cart/cart-shipping.php
    truemag-child/woocommerce/cart/cart-totals.php version 2.3.0 is out of date. The core version is 2.3.6
    truemag-child/woocommerce/cart/cart.php version 2.3.0 is out of date. The core version is 2.3.8
    truemag/woocommerce/cart/shipping-calculator.php
    truemag-child/woocommerce/checkout/form-billing.php
    truemag-child/woocommerce/checkout/form-checkout.php
    truemag-child/woocommerce/checkout/form-coupon.php
    truemag-child/woocommerce/checkout/form-login.php
    truemag-child/woocommerce/checkout/form-pay.php version 1.6.4 is out of date. The core version is 2.5.0
    truemag-child/woocommerce/checkout/review-order.php
    truemag-child/woocommerce/checkout/thankyou.php
    truemag-child/woocommerce/content-product.php version 1.6.4 is out of date. The core version is 2.5.0
    truemag-child/woocommerce/content-single-product.php
    truemag-child/woocommerce/content-widget-product.php version - is out of date. The core version is 2.5.0
    truemag-child/woocommerce/loop/add-to-cart.php version 2.1.0 is out of date. The core version is 2.5.0
    truemag-child/woocommerce/loop/orderby.php
    truemag-child/woocommerce/loop/price.php
    truemag-child/woocommerce/myaccount/my-account.php
    truemag-child/woocommerce/single-product/related.php
    
    : Learn how to update outdated templates

    https://ww.wp.xz.cn/plugins/woocommerce/

Viewing 11 replies - 16 through 26 (of 26 total)
  • Thread Starter ohgreatapollo

    (@ohgreatapollo)

    So when I’m calling my cart I obviously can’t use wc->ajax_url() because it will call the admin-ajax.php when I’m using the cart. Is there a new variable in the frontend that has been applied to the new url?

    Plugin Contributor Mike Jolley

    (@mikejolley)

    Why is this even an issue? Why are you using those endpoints in your code? I don’t understand.

    I assume cart functionality (as per your original post) works fine on the default themes?

    Thread Starter ohgreatapollo

    (@ohgreatapollo)

    Yes it does.

    And honestly I don’t know why this is even an issue.

    I’m working on it for a client and I’ve already put so many hours into trying to fix the issue and I can’t even seem to find what the problem is at all.

    This was a present issue on this dev site when I came along. I didn’t even do the updating of WordPress/WooCommerce.

    Plugin Contributor Mike Jolley

    (@mikejolley)

    I suggest re-installing 2.5.5 then, in case your files are outdated.

    And if you’re running caching plugins, clear all caches. It’s not right that references to admin-ajax are still in place. WC core just doesn’t use them any more on the frontend.

    Thread Starter ohgreatapollo

    (@ohgreatapollo)

    So I performed a full clear of all caching plugins. Neither of them are on right now.

    I reinstalled WC 2.5.5.

    I checked the default theme/parent theme again both of them work. Both of them also have those calls at the bottom of the page in the footer for the params but it doesn’t affect it in those themes.

    I found a custom woocommerce.php file in the root of our child theme. I’m wondering if there is a new way to set the default template in WC now because it looks like we’re using that file to create our product pages and I’m not sure if there is a new way to do that in WC 2.5.5 as there was in 2.2.10

    This is what our woocommerce.php looks like. I’m wondering what this file is even doing considering the templates should be placed in the /theme-child/woocommerce/templates not in the root directory of the theme. Could that be overriding the actual functions WC needs?

    <?php
    /* This is default template for Woo */
    global $global_page_layout;
    $layout = get_post_meta(get_the_ID(),'sidebar',true);
    if(is_shop()){
    	$layout = get_post_meta(get_option('woocommerce_shop_page_id'),'sidebar',true);
    }
    if(!$layout){
    	$layout = $global_page_layout ? $global_page_layout : ot_get_option('page_layout','right');
    }
    if(is_product() && !is_active_sidebar( 'single_woo_sidebar' )){
    	$layout = 'full';
    }
    global $sidebar_width, $post, $wp_query, $is_course, $video_stream_url;
    get_header();
    $is_course = false;
    $video_stream_url = '';
    $topnav_style = ot_get_option('topnav_style','dark');
    $layout = isset($wp_query->query_vars['csoftware']) && !empty($wp_query->query_vars['csoftware']) ? 'full' : $layout;
    ?>
    	<?php if (!is_product() && !is_tax('shop_vendor') && !is_tax('csoftware')) { ?>
    		<div class="blog-heading <?php echo $topnav_style=='light'?'heading-light':'' ?> wc">
    			<div class="container">
    				<?php if (isset($_GET['from404']) && $_GET['from404'] == 1) { ?>
    					<h1>Sorry Page Not Found - Have Some Free Sounds!</h1>
    				<?php } else { ?>
    					<?php
    						if (is_shop()) {
    							_e( do_shortcode('[custom_sound_search]') );
    						} else {
    							global $wp_query;
    							if (!empty($wp_query->query_vars['genre']) && !empty($wp_query->query_vars['synth'])) {
    								$title = '';
    								$g = get_term_by('slug', $wp_query->query_vars['genre'], 'genre');
    								$s = get_term_by('slug', $wp_query->query_vars['synth'], 'synth');
    								if (!empty($g) && !empty($s)) $title = $g->name . ' & ' . $s->name;
    								if (!empty($title)) {
    									?><h1><?php _e($title) ?></h1><?php
    								}
    							} else {
    								?><h1>
    									<?php if(is_single()){ the_title(); }else{ woocommerce_page_title(); } ?>
    									<?php
    										$presets = '';
    										if (isset($wp_query->query_vars['genre']) && !empty($wp_query->query_vars['genre'])) $presets = ' presets';
    										if (isset($wp_query->query_vars['synth']) && !empty($wp_query->query_vars['synth'])) $presets = ' presets';
    										if (isset($wp_query->query_vars['product_cat']) && !empty($wp_query->query_vars['product_cat']) && $wp_query->queried_object_id != 3404 && $wp_query->queried_object->parent != 3404) $presets = ' presets';
    										_e($presets);
    									?>
    								</h1>
    								<?php
    								if (!empty($wp_query->query_vars['synth']) || !empty($wp_query->query_vars['product_cat'])) {
    									if ($wp_query->queried_object_id == 3404 || $wp_query->queried_object->parent == 3404) {
    										$product_cats = get_term_children(3404, 'product_cat');
    										?>
    										<div class="dropdown-wrp type-genre dark">
    											<select>
    												<option value="">Category</option>
    												<?php foreach ($product_cats as $pc_id) { ?>
    													<?php $pc = get_term_by('id', $pc_id, 'product_cat'); ?>
    													<option value="<?php _e($pc->slug) ?>"><?php _e($pc->name) ?></option>
    												<?php } ?>
    											</select>
    											<i class="fa fa-caret-up"></i>
    											<i class="fa fa-caret-down"></i>
    										</div>
    										<script type="text/javascript">
    											jQuery(function ($)
    											{
    												var $genreDD = $(".dropdown-wrp.type-genre.dark select");
    												$genreDD.on("change", function (e)
    												{
    													e.preventDefault();
    													var $this = $(this),
    														pc = $this.val();
    													if (pc.length > 0)
    													{
    														var link = "<?php _e( trailingslashit( get_bloginfo('url') ) ) ?>";
    														link += "product-category/software/" + pc + "/";
    														window.location.href = link;
    													}
    												});
    											});
    										</script>
    
    										<?php
    									} else {
    										$genre = get_terms('genre', array('hide_empty' => true));
    										?>
    										<div class="dropdown-wrp type-genre dark">
    											<select>
    												<option value="">FILTER BY GENRE</option>
    												<?php foreach ($genre as $g) { ?>
    													<option value="<?php _e($g->slug) ?>"><?php _e($g->name) ?></option>
    												<?php } ?>
    											</select>
    											<i class="fa fa-caret-up"></i>
    											<i class="fa fa-caret-down"></i>
    										</div>
    										<script type="text/javascript">
    											jQuery(function ($)
    											{
    												var $genreDD = $(".dropdown-wrp.type-genre.dark select");
    												$genreDD.on("change", function (e)
    												{
    													e.preventDefault();
    													var $this = $(this),
    														genre = $this.val();
    													if (genre.length > 0)
    													{
    														var link = "<?php _e( trailingslashit( get_bloginfo('url') ) ) ?>";
    														link += "genre/" + genre + "/";
    														link += "synth/<?php _e($wp_query->query_vars['synth']) ?>/";
    														window.location.href = link;
    													}
    												});
    											});
    										</script>
    									<?php } ?>
    								<?php }
    							}
    						}
    					?>
    				<?php } ?>
    				<div class="clear"></div>
    			</div>
    		</div><!--blog-heading-->
    	<?php } ?>
        <div id="body">
    		<?php if (is_product()) { ?>
    			<?php
    				global $product;
    				$is_course = is_course($product->id);
    				$is_software = is_software($product->id);
    				if ($is_course) {
    					$layout = 'full';
    					$sidebar_width = '0';
    					$video_stream_url = get_post_meta($product->id, 'video_stream_url', true);
    					/*
    					?>
    					<div class="woocommerce-single-top course-product">
    						<div class="container">
    							<div class="row">
    								<div class="product-image">
    									<?php if(has_post_thumbnail(get_the_ID()))echo get_the_post_thumbnail(get_the_ID(), 'post-thumbnail'); ?>
    									<?php if ( $product->is_on_sale() ) : ?>
    										<?php echo apply_filters( 'woocommerce_sale_flash', '<span class="onsale">' . __( 'Sale!', 'woocommerce' ) . '</span>', $post, $product ); ?>
    									<?php endif; ?>
    								</div>
    								<div class="single-product-meta">
    									<h1 class="single-product-title"><?php the_title() ?></h1>
    									<div class="clear cl-top"></div>
    									<?php if (is_in_cart(get_the_ID())) { ?>
    										<a href="#" rel="nofollow" data-product_id="" data-product_sku="" data-quantity="0" class="button add_to_cart_button product_type_simple added">ADDED</a>
    									<?php } else { ?>
    										<a href="/product/horizon/?add-to-cart=<?php the_ID() ?>" rel="nofollow" data-product_id="<?php the_ID() ?>" data-product_sku="<?php _e($product->get_sku()) ?>" data-quantity="1" class="button add_to_cart_button product_type_simple">DOWNLOAD <?php _e(get_woocommerce_currency_symbol() . ' ' . $product->price) ?></a>
    									<?php } ?>
    									<?php if (!empty($video_stream_url)) { ?>
    										&nbsp;&nbsp;&nbsp;<a href="<?php _e($video_stream_url) ?>" class="button add_to_cart_button product_type_simple">STREAM $19.99</a>
    									<?php } ?>
    									<a href="#" class="css-3-anim content-product-single-twitter"><i class="fa fa-twitter"></i></a>
    									<a href="#" class="css-3-anim content-product-single-facebook"><i class="fa fa-facebook"></i></a>
    									<a href="#" class="css-3-anim content-product-single-heart"><i class="fa fa-heart"></i></a>
    									<?php if (is_user_logged_in()) { ?><div class="wishlist-helper"><?php _e(do_shortcode('[yith_wcwl_add_to_wishlist]')) ?></div><?php } ?>
    									<div class="clear cl-bot"></div>
    									<div class="clear"></div>
    								</div>
    							</div>
    						</div>
    					</div>
    					<?php */ ?>
    				<?php } else if ($is_software) { ?>
    					<?php
    						global $post;
    						$layout = 'right';
    						$sidebar_width = '';
    						$related_tutorial_cats = get_related_tutorial_cats($product->id);
    						if (empty($related_tutorial_cats)) {
    							$layout = 'full';
    							$sidebar_width = '0';
    						}
    						$soft_demo_download = get_post_meta($product->id, 'soft_demo_download', true);
    						// if (!empty($soft_demo_download)) {
    							// $soft_demo_download = get_post($soft_demo_download);
    							// if (!empty($soft_demo_download)) {
    								// $soft_demo_download = $soft_demo_download->guid;
    							// }
    						// }
    
    						$subtitle = get_post_meta($product->id, 'soft_subtitle', true);
    
    						$trms = wp_get_post_terms(get_the_ID(), 'shop_vendor');
    						$vendors = array();
    						if (!empty($trms)) {
    							foreach ($trms as $trm) {
    								if ($trm->term_id == 1005) continue;
    								$vendors[] = array(
    									'name' => $trm->name,
    									'url' => get_term_link($trm, 'shop_vendor')
    								);
    							}
    						}
    					?>
    				<div class="woocommerce-single-top software">
    					<div class="container">
    						<div class="row">
    							<div class="left">
    								<h1><?php _e($post->post_title) ?></h1>
    								<h2><?php _e($subtitle) ?></h2>
    								<?php if (!empty($vendors)) { ?>
    									<span class="by">
    										By&nbsp;
    										<?php $i = 0; ?>
    										<?php foreach ($vendors as $sv) { ?>
    											<?php if ($i > 0) { ?><span class="separator">,&nbsp;</span><?php } ?><a href="<?php _e($sv['url']) ?>" class="lnk"><?php _e($sv['name']) ?></a><?php $i++; ?>
    										<?php } ?>
    									</span>
    								<?php } ?>
    								<span class="demoIntro">Software Audio Demo</span>
    								<div class="demo">
    									<a href="#" class="css-3-anim content-product-single-play"><i class="fa fa-play"></i></a>
    									<script>
    									jQuery(function ($)
    									{
    										$(".woocommerce-single-top a.content-product-single-play").on("click", function (e)
    										{
    											e.preventDefault();
    											if (typeof window.exampleStream === "object")
    											{
    												var $this = $(this);
    												var $i = $this.find("i");
    												if ($i.hasClass("fa-play"))
    												{
    													$i.removeClass("fa-play").addClass("fa-pause");
    													window.exampleStream.play();
    												}
    												else
    												{
    													$i.removeClass("fa-pause").addClass("fa-play");
    													window.exampleStream.pause();
    												}
    											}
    										});
    									});
    									</script>
    									<?php render_waveform( get_the_ID() ) ?>
    									<div class="clear"></div>
    								</div>
    								<div class="clear"></div>
    								<div class="price"><?php _e(get_woocommerce_currency_symbol() . ' ' . $product->get_price()) ?></div>
    								<?php if (is_in_cart(get_the_ID())) { ?>
    									<a href="#" rel="nofollow" data-product_id="" data-product_sku="" data-quantity="0" class="button add_to_cart_button product_type_simple added">ADDED</a>
    								<?php } else { ?>
    									<a href="/product/horizon/?add-to-cart=<?php the_ID() ?>" rel="nofollow" data-product_id="<?php the_ID() ?>" data-product_sku="<?php _e($product->get_sku()) ?>" data-quantity="1" class="button add_to_cart_button product_type_simple">ADD TO CART</a>
    								<?php } ?>
    								<?php if (!empty($soft_demo_download)) { ?>
    									<a href="<?php _e($soft_demo_download) ?>" rel="nofollow" class="btn grey">DOWNLOAD DEMO</a>
    								<?php } ?>
    							</div>
    							<div class="right">
    								<script src="<?php _e( trailingslashit( get_stylesheet_directory_uri() ) ) ?>js/jquery.bxslider.min.js" type="text/javascript"></script>
    								<link rel="stylesheet" href="<?php _e( trailingslashit( get_stylesheet_directory_uri() ) ) ?>css/jquery.bxslider.css?v=2" type="text/css" media="all" />
    								<?php
    									$attachment_ids = $product->get_gallery_attachment_ids();
    									$carousel_imgs = array();
    									foreach ($attachment_ids as $attachment_id)  {
    										$carousel_imgs[] = wp_get_attachment_url($attachment_id);
    									}
    								?>
    								<?php if (!empty($carousel_imgs)) { ?>
    									<div class="carousel">
    										<?php foreach ($carousel_imgs as $ci) { ?>
    											<div class="slide invisible"><img src="<?php _e($ci) ?>" alt="" /></div>
    										<?php } ?>
    									</div>
    									<script type="text/javascript">
    									jQuery(function ($)
    									{
    										var $bxSlider = $(".carousel").bxSlider({
    											minSlides: 1,
    											maxSlides: 1,
    											slideMargin: 0,
    											pager: false,
    											controls: false
    										});
    										$(".next-post.same-cat a").on("click", function (e)
    										{
    											e.preventDefault();
    											$bxSlider.goToNextSlide();
    										});
    										$(".prev-post.same-cat a").on("click", function (e)
    										{
    											e.preventDefault();
    											$bxSlider.goToPrevSlide();
    										});
    										$(".slide").removeClass("invisible");
    									});
    									</script>
    									<div class="player-button">
    										<div class="prev-post same-cat"><a href="#" rel="next"><i class="fa fa-chevron-left"></i></a></div>
    										<div class="next-post same-cat"><a href="#" rel="prev"><i class="fa fa-chevron-right"></i></a> </div>
    								   </div>
    							   <?php } ?>
    							</div>
    						</div>
    					</div>
    				</div>
    				<?php } else { ?>
    				<?php
    					$tax = array(
    						'synth',
    						'shop_vendor'
    					);
    					$tax_output = array();
    					foreach ($tax as $t) {
    						$trms = wp_get_post_terms(get_the_ID(), $t);
    						if (!empty($trms)) {
    							foreach ($trms as $trm) {
    								if ($trm->term_id == 1005) continue;
    								if (!isset($tax_output[$t])) $tax_output[$t] = array();
    								$tax_output[$t][] = array(
    									'name' => $trm->name,
    									'url' => get_term_link($trm, $t)
    								);
    							}
    						}
    					}
    					$sidebar_width = '0';
    				?>
    				<div class="woocommerce-single-top">
    					<div class="container">
    						<div class="row">
    							<div class="product-image">
    								<?php if(has_post_thumbnail(get_the_ID()))echo get_the_post_thumbnail(get_the_ID(),'thumb_179x121'); ?>
    								<?php if ( $product->is_on_sale() ) : ?>
    									<?php echo apply_filters( 'woocommerce_sale_flash', '<span class="onsale">' . __( 'Sale!', 'woocommerce' ) . '</span>', $post, $product ); ?>
    								<?php endif; ?>
    							</div>
    							<div class="single-product-meta">
    								<h1 class="single-product-title"><?php the_title() ?></h1>
    								<?php if (!empty($tax_output['shop_vendor'])) { ?>
    									<div class="tax-meta">
    										<span class="lbl">By</span>
    										<?php $i = 0; ?>
    										<?php foreach ($tax_output['shop_vendor'] as $sv) { ?>
    											<?php if ($i > 0) { ?><span class="separator">,&nbsp;</span><?php } ?><a href="<?php _e($sv['url']) ?>" class="lnk"><?php _e($sv['name']) ?></a><?php $i++; ?>
    										<?php } ?>
    									</div>
    								<?php } ?>
    								<?php if (!empty($tax_output['synth'])) { ?>
    									<div class="tax-meta">
    										<span class="lbl">For</span>
    										<?php $i = 0; ?>
    										<?php foreach ($tax_output['synth'] as $sy) { ?>
    											<?php if ($i > 0) { ?><span class="separator">,&nbsp;</span><?php } ?><a href="<?php _e($sy['url']) ?>" class="lnk"><?php _e($sy['name']) ?></a><?php $i++; ?>
    										<?php } ?>
    									</div>
    								<?php } ?>
    								<div class="clear cl-top"></div>
    								<?php if ( $price_html = $product->get_price_html() ) : ?>
    									<div class="price"><?php echo $price_html; ?><div class="clear"></div></div>
    								<?php endif; ?>
    								<div class="clear"></div>
    								<?php if (is_in_cart(get_the_ID())) { ?>
    									<a href="#" rel="nofollow" data-product_id="" data-product_sku="" data-quantity="0" class="button add_to_cart_button product_type_simple added">ADDED</a>
    								<?php } else { ?>
    									<a href="/product/horizon/?add-to-cart=<?php the_ID() ?>" rel="nofollow" data-product_id="<?php the_ID() ?>" data-product_sku="<?php _e($product->get_sku()) ?>" data-quantity="1" class="button add_to_cart_button product_type_simple">ADD TO CART</a>
    								<?php } ?>
    								<a href="#" class="css-3-anim content-product-single-twitter"><i class="fa fa-twitter"></i></a>
    								<a href="#" class="css-3-anim content-product-single-facebook"><i class="fa fa-facebook"></i></a>
    								<a href="#" class="css-3-anim content-product-single-heart"><i class="fa fa-heart"></i></a>
    								<div class="wishlist-helper"><?php _e(do_shortcode('[yith_wcwl_add_to_wishlist]')) ?></div>
    								<div class="clear cl-bot"></div>
    								<a href="#" class="css-3-anim content-product-single-play"><i class="fa fa-play"></i></a>
    								<script>
    								jQuery(function ($)
    								{
    									$(".woocommerce-single-top a.content-product-single-play").on("click", function (e)
    									{
    										e.preventDefault();
    										if (typeof window.exampleStream === "object")
    										{
    											var $this = $(this);
    											var $i = $this.find("i");
    											if ($i.hasClass("fa-play"))
    											{
    												$i.removeClass("fa-play").addClass("fa-pause");
    												window.exampleStream.play();
    											}
    											else
    											{
    												$i.removeClass("fa-pause").addClass("fa-play");
    												window.exampleStream.pause();
    											}
    										}
    									});
    								});
    								</script>
    								<?php render_waveform( get_the_ID() ) ?>
    								<div class="clear"></div>
    							</div>
    						</div>
    					</div>
    				</div>
    			<?php } ?>
    		<?php } ?>
    		<?php if (is_tax('shop_vendor') || is_tax('csoftware')) { ?>
    			<?php add_filter('woocommerce_show_page_title', '__return_false'); ?>
    			<?php remove_all_actions('woocommerce_archive_description'); ?>
    			<div class="woocommerce-vendor-top <?php _e(is_tax('csoftware') ? 'csoftware-top' : '') ?>">
    				<div class="container">
    					<div class="row">
    						<?php global $wp_query; ?>
    						<?php $img = z_taxonomy_image_url($wp_query->queried_object->term_id); ?>
    						<div class="l <?php _e(empty($img) ? 'full' : '') ?>">
    							<h1><?php if(is_single()){ the_title(); }else{ woocommerce_page_title(); } ?><?php _e(is_tax('csoftware') ? ' courses' : '') ?><?php _e(is_tax('shop_vendor') && ($wp_query->queried_object->term_id != 3262 && $wp_query->queried_object->term_id != 3388) ? ' presets' : '') ?></h1>
    							<?php if (is_tax('shop_vendor')) {?>
    								<?php
    									$user_id = get_current_user_id();
    									$vndr_follow = new VendorFollow($user_id);
    									$is_following = $vndr_follow->is_following($wp_query->queried_object->term_id);
    								?>
    								<?php if ($is_following) { ?>
    									<a href="#" class="followVendor following">FOLLOWING <?php if(is_single()){ the_title(); }else{ woocommerce_page_title(); } ?></a>
    								<?php } else { ?>
    									<a href="#" class="followVendor trigger">FOLLOW <?php if(is_single()){ the_title(); }else{ woocommerce_page_title(); } ?></a>
    								<?php } ?>
    							<?php } ?>
    							<div class="share-wrp">
    								<a href="#" class="css-3-anim content-product-single-twitter"><i class="fa fa-twitter"></i></a>
    								<a href="#" class="css-3-anim content-product-single-facebook"><i class="fa fa-facebook"></i></a>
    							</div>
    							<div class="vendor-desc"><?php _e($wp_query->queried_object->description); ?></div>
    						</div>
    						<?php if (!empty($img)) { ?>
    							<div class="r">
    								<img src="<?php _e($img) ?>" alt="<?php _e( esc_attr( $wp_query->queried_object->name ) ) ?>" />
    							</div>
    						<?php } ?>
    						<div class="clear"></div>
    					</div>
    				</div>
    			</div>
    			<?php if (is_tax('csoftware')) { ?>
    				<?php
    					global $wp_query;
    					$banner_img = get_option('custom_csoftware_data' . '_' . 'csoftware' . '_' . $wp_query->queried_object->term_id);
    					$banner_img = is_array($banner_img) ? $banner_img['banner_img'] : $banner_img;
    					if (is_numeric($banner_img)) {
    						$banner_img = get_post($banner_img);
    						if (!empty($banner_img)) {
    							$banner_img = $banner_img->guid;
    						}
    					}
    					$banner_url = get_option('csoftware-' . $wp_query->queried_object->term_id . '-banner_url');
    					if (!empty($banner_img)) {
    					?>
    						<div class="container csoftware-banner-wrp">
    							<div class="row">
    								<?php if (!empty($banner_url)) { ?><a href="<?php _e($banner_url) ?>"><?php } ?>
    									<img src="<?php _e($banner_img) ?>" alt="" />
    								<?php if (!empty($banner_url)) { ?></a><?php } ?>
    							</div>
    						</div>
    					<?php } ?>
    			<?php } ?>
    		<?php } ?>
            <div class="container">
                <div class="row">
    				<div id="content" class="<?php echo $layout!='full'?($sidebar_width?'col-md-9':'col-md-8'):'col-md-12' ?><?php echo ($layout == 'left') ? " revert-layout":"";?>" role="main">
    				<?php
    					if (is_product()) {
    						if (is_software($product->id)) {
    							$soft_overview = get_post_meta($product->id, 'soft_overview', true);
    							$soft_features = get_post_meta($product->id, 'soft_features', true);
    							$soft_system_requirements = get_post_meta($product->id, 'soft_system_requirements', true);
    							$tabs = array(
    								'soft_overview' => $soft_overview,
    								'soft_features' => $soft_features,
    								'soft_system_requirements' => $soft_system_requirements
    							);
    							foreach ($tabs as &$t) $t = html_entity_decode($t);
    
    							$intro = get_post_meta($product->id, 'soft_intro', true);
    							?>
    							<div class="softwareContent">
    								<script src="<?php _e( trailingslashit( get_stylesheet_directory_uri() ) ) ?>js/jquery.hashchange.min.js" type="text/javascript"></script>
    								<script src="<?php _e( trailingslashit( get_stylesheet_directory_uri() ) ) ?>js/jquery.easytabs.min.js" type="text/javascript"></script>
    								<h3 class="featSoftSubtitle"><?php _e($intro) ?></h3>
    								<div id="tab-container" class="tab-container">
    								<ul class='etabs'>
    									<?php if (!empty($tabs['soft_overview'])) { ?>
    										<li class='tab'><a href="#overview">Overview</a></li>
    									<?php } ?>
    									<?php if (!empty($tabs['soft_features'])) { ?>
    										<li class='tab'><a href="#features">Features</a></li>
    									<?php } ?>
    									<?php if (!empty($tabs['soft_system_requirements'])) { ?>
    										<li class='tab'><a href="#system-requirements">System Requirements</a></li>
    									<?php } ?>
    								</ul>
    								<div class="clear"></div>
    								<?php if (!empty($tabs['soft_overview'])) { ?>
    									<div id="overview" class="tabContent"><?php _e($tabs['soft_overview']) ?></div>
    								<?php } ?>
    								<?php if (!empty($tabs['soft_features'])) { ?>
    									<div id="features" class="tabContent"><?php _e($tabs['soft_features']) ?></div>
    								<?php } ?>
    								<?php if (!empty($tabs['soft_system_requirements'])) { ?>
    									<div id="system-requirements" class="tabContent"><?php _e($tabs['soft_system_requirements']) ?></div>
    								<?php } ?>
    								</div>
    								<script type="text/javascript">
    									jQuery(function ($)
    									{
    										$('#tab-container').easytabs();
    										// $(".tabContent").removeClass("invisible");
    									});
    								</script>
    							</div>
    							<?php
    						} else {
    							the_content();
    						}
    					} else {
    						//content
    						if (!empty($wp_query->query_vars['product_cat']) && ($wp_query->queried_object_id == 3404 || $wp_query->queried_object->parent == 3404)) {
    							global $woocommerce_loop;
    							$woocommerce_loop['columns'] = 3;
    						}
    						woocommerce_content();
    						//share
    						$social_post= get_post_meta($post->ID,'showhide_social',true);
    						if($social_post=='show'){ //check if show social share
    							custom_gp_social_share(get_the_ID());
    						}
    						if($social_post=='def'){
    							if(ot_get_option( 'page_show_socialsharing', 1)){ //check if show social share
    								custom_gp_social_share(get_the_ID());
    							}
    						}
    					}
    					?>
    				</div><!--#content-->
    				<?php
    				if($layout != 'full'){
    					get_sidebar();
    				}?>
    				<?php
    					if (is_product() && !is_software($product->id)) {
    						echo '<div class="clear"></div>';
    						echo do_shortcode( '[rf_recommendations]' );
    					}
    				?>
                </div><!--/row-->
            </div><!--/container-->
    		<?php if (is_product()) { ?>
    			<?php if ($is_course) { require_once('bottom-course-panel.php'); } ?>
    			<div class="yotpo-reviews-wrp">
    				<div class="container">
    					<div class="row">
    						<div class="col-md-12 yotpo-reviews">
    							<h2>Reviews of this product</h2>
    							<?php
    								if (function_exists('wc_yotpo_show_widget')) {
    									// wc_yotpo_show_widget()
    									$product = get_product();
    									if($product->post->comment_status == 'open') {
    										$product_data = wc_yotpo_get_product_data($product);
    										$id_on_old_website = get_post_meta($product_data['id'], '_id_on_old_website', true);
    										if (!empty($id_on_old_website) && is_numeric($id_on_old_website)) $product_data['id'] = $id_on_old_website;
    										$yotpo_div = "<div class='yotpo yotpo-main-widget'
    													data-product-id='".$product_data['id']."'
    													data-name='".$product_data['title']."'
    													data-url='".$product_data['url']."'
    													data-image-url='".$product_data['image-url']."'
    													data-description='".$product_data['description']."'
    													data-lang='".$product_data['lang']."'></div>";
    										echo $yotpo_div;
    									}
    								}
    							?>
    						</div>
    					</div>
    				</div>
    			</div>
    		<?php } ?>
        </div><!--/body-->
    <?php get_footer(); ?>
    Plugin Contributor Mike Jolley

    (@mikejolley)

    That woocommerce.php is highly custom. This template will be used instead of any templates in WooCommerce itself since its a catch-all solution.

    You mentioned the params were there with another theme? Could that mean you have a plugin adding that code instead I wonder?

    Thread Starter ohgreatapollo

    (@ohgreatapollo)

    It could be but my concern is why would it not work in the current theme and work in the default theme. Even with those params.

    Plugin Contributor Mike Jolley

    (@mikejolley)

    Not sure on that one, but those params are definitely invalid.

    If you remove or rename your custom woocommerce.php template file, does adding to cart work then?

    Thread Starter ohgreatapollo

    (@ohgreatapollo)

    I tried, it didn’t work.

    I did however notice that on the product pages when you hover over the Add To Cart button it shows the proper link to add to cart but when I click it just nothing happens.

    That means that all my woocommerce.php code is actually doing what it’s supposed to and detecting whether the product is in the cart, displaying the right button and putting the right url behind it.

    However, I am still unsure what would be breaking the middle ground that actually makes the button work when you click it. It just appears to be unclickable not that it doesn’t work.

    I believe this to be the same on the homepage because the button has some jQuery code built into it to display the “added to cart” message and the link is working in the code. It just doesn’t seem to make a whole lot of sense.

    Thread Starter ohgreatapollo

    (@ohgreatapollo)

    Maybe this will help with the issue.

    The remove item from cart doesn’t work either.

    I was able to resolve it to the fact that you can now right click and open in a new tab and it adds the item to the cart.

    Just such an odd issue.

    Plugin Contributor Mike Jolley

    (@mikejolley)

    I think you should enlist the aid of whomever coded that template file for you. I’m not even sure of it’s purpose so I cannot just ‘fix’ it up 🙂

    > The remove item from cart doesn’t work either.

    You had other template overrides in the theme, so one of those may be out of date regarding this. In fact, yes the report says they are outdated.

Viewing 11 replies - 16 through 26 (of 26 total)

The topic ‘Cart Functionality Broken On Update’ is closed to new replies.