Ecommerce software home
Shopping Cart Software Forum for Ecommerce Templates
 
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

Find us on Facebook Follow us on Twitter View our YouTube channel
Search our site
Forum Search
Google Site Search
 All Forums
 Technical
 PHP (Unix / Linux / Apache) versions
 Updated to 7.1.8 and Add to Cart Not Working
Author « Topic »  

Aldebaran
Ecommerce Template Expert

USA
652 Posts

Posted - 02/11/2020 :  15:22:48  
Hi,
We updated to 7.1.8 yesterday and our Add to Cart button results in nothing being added to the cart. It worked before the update.

Here is the PHP:
<?php
session_cache_limiter('none');
session_start();
ob_start(); ?>
<?php
$GLOBALS['ectcartpage']='proddetail';
$GLOBALS['showinstock']=FALSE;
//******************************
//Changed on Mon Mar 6 to prevent need for ECT Core Update Plugin Which Has Been Deleted
//require('./wp-blog-header.php');
//get_header();
require('./wp-config.php');
$wp->init();
$wp->parse_request();
$wp->query_posts();
$wp->register_globals();
get_header();
//****************************
?>
<div id="main-content" class="main-content">
<div id="primary" class="content-area">
<div id="content" class="site-content" role="main">
<div class="entry-content">

<h1 class="entry-title"><?php echo get_the_title($post); ?></h1>

<?php
$explicitid = "MSC-144";
include "vsadmin/inc/incproddetail.php";
?>
<?php
// Start the Loop.
while ( have_posts() ) : the_post();

do_action( 'storefront_page_before' );

// Include the page content template.
//get_template_part( 'content', 'page' ); // Commented out the standard theme content area

echo "<br /><br />";
// Just the content, not the title, since that's needed above the ECT store code
the_content();

do_action( 'storefront_page_after' );

;

endwhile;
?>


</div><!-- #entry-content -->
</div>
</div><!-- #content -->
</div><!-- #primary -->
<?php
do_action( 'storefront_sidebar' );
get_footer();

----------------------------------

and the resulting HTML around the Add to Cart button

-----------


<div id="mainbodyspan" class="proddetail MSC-144" itemscope itemtype="http://schema.org/Product"><form method="post" id="ectform0" action="cart.php" onsubmit="return formvalidator0(this)" style="margin:0px;padding:0px;"><script type="text/javascript">/* <![CDATA[ */sz('MSC-144',20,0,'',983892);function setvals0(){
optacpc[0]='';optmaxc[0]=0;opttype[0]=3;optperc[0]=false;
}
function updateprice0(){
setvals0();updateprice(1,0,20,0,'MSC-144',0,false,true,false);}
function formvalidator0(theForm){
setvals0();return(ectvalidate(theForm,1,0,false,false));}
/* ]]> */</script><input type="hidden" name="id" value="MSC-144" />
<input type="hidden" name="mode" value="add" />
<div class="prodnavigation detailprodnavigation"><a class="ectlink" href="../">Home</a> » <a class="ectlink" href="products.php?cat=4">MISC</a></div><div class="checkoutbutton detailcheckoutbutton"> <input type="button" value="Checkout" class="ectbutton checkoutbutton detailcheckoutbutton" onclick="ectgonoabs('cart.php')" /></div><div class="detailid"><span class="prodidlabel detailidlabel">Product ID</span> <span itemprop="productID">MSC-144</span></div><div class="detailname"><span itemprop="name">Extended Service Area Payment - Ken</span></div><div class="detaildescription" itemprop="description"><br><br><p>After you have scheduled your session(s) with your trainer, please pay the extended service area travel fee for each session. For example, if you have scheduled 3 private sessions, then increase the Quantity to 3.</p></div><div class="detailprice" itemprop="offers" itemscope itemtype="http://schema.org/Offer"><meta itemprop="priceCurrency" content="USD"><strong>Price:</strong> <span class="price" id="pricediv0" itemprop="price" content="20.00">$20.00</span> </div><div class="detailquantity"><div class="detailquantitytext">Quantity:</div><div class="quantity0div detailquantity0div"><input type="text" name="quant" id="w0quant" size="2" maxlength="5" value="1" title="Quantity" class="quantity0input detailquantity0input"></div>
</div><div class="detailoptions"><div class="ectoptioncontainer ecttextoption"><div class="optiontext detailoptiontext"><span class="detailoption"><label for="optn0x0">Extended Service Area Private Training Session</label></span></div><div class="option detailoption"> <input data-optgroup="184" type="hidden" name="optn0" value="978" /><textarea data-optgroup="184" class="prodoption detailprodoption" name="voptn0" id="optn0x0" cols="30" rows="5">Please list the dates of the session(s) that you are paying the travel fee for.</textarea></div></div></div><div class="addtocart detailaddtocart"><input type="submit" value="Add to cart" class="ectbutton buybutton detailbuybutton" /></div></form></div><script type="text/javascript">updateprice0();</script>
<br /><br />

Jill Olkoski
Small Business Website Design
Aldebaran Web Design, Seattle WA
AldebaranWebDesign.com

dbdave
ECT Moderator

USA
10516 Posts

Posted - 02/11/2020 :  15:51:22  
Hi, the first thing to check is that you are linked to the javascript file, and you are using the latest version that came with the updater.
More info here - https://www.ecommercetemplates.com/support/topic.asp?TOPIC_ID=107040

Let us know if that's not the issue.

Thanks,
David

Aldebaran
Ecommerce Template Expert

USA
652 Posts

Posted - 02/11/2020 :  16:12:01  
Hi David,
I've added the javascript to the header file in WordPress, it didn't make a difference - but the javascript was missing so thank you for that! I definitely added the latest javascript file that came with the updater.

Here's an example of the page for you to view: http://ahimsadogtraining.com/miscPaymentPvtTravel-Ken.php

Please let me know what to try next,
Jill

Jill Olkoski
Small Business Website Design
Aldebaran Web Design, Seattle WA
AldebaranWebDesign.com

dbdave
ECT Moderator

USA
10516 Posts

Posted - 02/11/2020 :  16:31:33  
Hi, the add to cart button worked for me, so you might just need to hard refresh the page there.
The item did not add to the cart once I got there, so maybe you didn't link the .js file to all pages of your store, so check that.

Thanks,
David

Sinbad
ECT Moderator

USA
65937 Posts

Posted - 02/11/2020 :  21:01:27  
Hi Jill, checking the link provided once on the cart there were no items in cart, changing the link to https:// adds the item to the cart and the cart forwards to the checkout. Can you check that in the admin the store url and the SSL url are both set as https://yourdomain.com You may also need to do a 301 redirect from www to non-www this post contains several tips for how to check that the site urls are consistent on SSL https://www.ecommercetemplates.com/support/topic.asp?TOPIC_ID=106851

Winners never quit, quitters never win
CSS and Responsive Designs
User Manual for Ecommerce Templates

Aldebaran
Ecommerce Template Expert

USA
652 Posts

Posted - 02/12/2020 :  15:11:50  
"Hi Jill, checking the link provided once on the cart there were no items in cart, changing the link to https:// adds the item to the cart and the cart forwards to the checkout. Can you check that in the admin the store url and the SSL url are both set as https://yourdomain.com You may also need to do a 301 redirect from www to non-www this post contains several tips for how to check that the site urls are consistent on SSL https://www.ecommercetemplates.com/support/topic.asp?TOPIC_ID=106851"

The store URL and SSL url were https already, I created a 301 redirect and also changed the wordpress URL.

Thank you!!
Jill

Jill Olkoski
Small Business Website Design
Aldebaran Web Design, Seattle WA
AldebaranWebDesign.com
  « Topic »  
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2022 ecommercetemplates.com
This page was generated in 0.03 seconds. Snitz Forums 2000