Community @ The Turning Gate

Support community for TTG plugins and products.

NOTICE

The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.

This forum is now closed, and exists here as a read-only archive.

  • New user registrations are disabled.
  • Users cannot create new topics.
  • Users cannot reply to existing topics.

You are not logged in.

#1 2019-05-28 02:29:59

Nico3939
Member
From: France
Registered: 2016-10-05
Posts: 235
Website

Cart don't work (resolved)

Hi,

I have updated backlight v1 to v2, but now cart don't work

A message says: "No products available for purchase"

I haven't modified since backlight V1 and I worked like a charm in v1

Any idea please?
Thanks
Nico

Last edited by Nico3939 (2019-06-05 23:45:39)

Offline

#2 2019-05-28 02:42:58

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Cart don't work (resolved)

Did you update album files?
Have you checked the album settings to make sure the pricing scheme is entered?


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#3 2019-05-28 02:47:09

Nico3939
Member
From: France
Registered: 2016-10-05
Posts: 235
Website

Re: Cart don't work (resolved)

Yes already do that.

Update album files
Checked in Lightroom the pricing sheme
and Reset the customer's cart in this browser
All product are ok
all pricing sheme are complete
Shipping method Ok

Nothing work

Last edited by Nico3939 (2019-05-28 02:47:44)

Offline

#4 2019-05-28 02:48:52

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Cart don't work (resolved)

Are any of your cart templates using Mixed Pricing?


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#5 2019-05-28 02:55:54

Nico3939
Member
From: France
Registered: 2016-10-05
Posts: 235
Website

Re: Cart don't work (resolved)

I think I found the problem,

It's like in v1 when you put an embed album in page.

Ben have found the problem on v1:

http://community.theturninggate.net/vie … hp?id=9770


But in v2 is still the problem?

Offline

#6 2019-05-28 03:01:26

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Cart don't work (resolved)

I think that was fixed. Make sure all your modules are up to date


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#7 2019-05-28 03:38:33

Nico3939
Member
From: France
Registered: 2016-10-05
Posts: 235
Website

Re: Cart don't work (resolved)

I say that because when I go to Backlight-->Top-level Galleries and View album, Cart work

But when I go to my page with embed gallery, Cart don't work

Offline

#8 2019-05-28 03:46:31

Nico3939
Member
From: France
Registered: 2016-10-05
Posts: 235
Website

Re: Cart don't work (resolved)

That's what's Ben says about the problem in Backlight 1 and Backlight 2:

Ben wrote:

Hi Nico,  I've found the problem.  Pages with embedded albums aren't including the album-specific pricing scheme name, which means that they default to the 'default' pricing scheme.

I've put in a silent update for the Pangolin Album.  Are you running the latest version of Backlight 1? (version 1.2.3).
If so, download the latest Backlight + Pages zip file (it should be called Backlight-Pages-123-Release7) and copy this single file from the extracted zip file into the respective directory on your server:

backlight/modules/pangolin-page/fragments/config-cart.php

You'll then need to clear your template cache (found under the Designer menu in the Backlight admin).

Can you let us know if that solves it for you?

Note I'll need to make a similar fix for Backlight 1's Standard album, and both the Standard and Pangolin albums for Backlight 2.

Offline

#9 2019-05-28 06:14:37

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Cart don't work (resolved)

Nico3939 wrote:

I say that because when I go to Backlight-->Top-level Galleries and View album, Cart work

But when I go to my page with embed gallery, Cart don't work

It’s been working in my testing


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#10 2019-05-28 06:37:43

Nico3939
Member
From: France
Registered: 2016-10-05
Posts: 235
Website

Re: Cart don't work (resolved)

So I find the solution:

As Ben sayd:

Pages with embedded albums aren't including the album-specific pricing scheme name, which means that they default to the 'default' pricing scheme.

So replace in this file:

backlight/modules/pangolin-page/fragments/config-cart.php

The original code by that:


<?php defined('APP_DIR') or die('No direct script access allowed in ' . __FILE__); ?>

<?php 
	$basePath  = URLHelper::resolvedPath(URLHelper::currentPageLocation(), PATH_TO_BASE); ?><thp>
	$shortSiteURL = '<?php echo shortSiteURL(); ?>';
	$moduleURL = $shortSiteURL.'backlight/modules/module-cart/';
</thp>

<script>
;(function ( $, window, undefined ) {

	var cartOptions = {
		rewrite_enabled : <?php echo URLHelper::rewriteEnabled() ? 'true' : 'false'; ?>,
		cart_url        : '<?php echo CartUtility::getCartURI(); ?>',
<thp>echo isset($album) && $album instanceof Album ? "\t\tpricing_scheme : '".$album->getPricingScheme()."',\n" : "";</thp>
		local_js_path   : '', // Prevents Cart from attempting to load hooks
		log_messages    : <thp>echo isset($_REQUEST['logMessages']) ? 'true' : 'false';</thp>,
	};

	cartOptions['cart_url'] += (cartOptions['cart_url'][cartOptions['cart_url'].length-1])!='/'?'/':'';
	$(function() {
		jQuery.getScript('<thp>echo $moduleURL;</thp>lib/js/jquery.ttgcart-pangolin.js', function() {
			if ("TTGCart" in window) {
				TTGCart.loadedHooks = true;
				$('body').ttgcart(cartOptions);
				cartOptions['cart_button_selector'] = '.add-package-to-cart';
				$('body').ttgpackage(cartOptions);
			}
		});
	});

}(jQuery, window));
</script>

You'll then need to clear your template cache (found under the Designer menu in the Backlight admin).

And maybe Reset the customer's cart in this browser (found under the Cart menu in Backlight admin)


So Ben has to update this file for the next update

Maybe I made mistakes, I'm not expert in php coding!

Thank you Rod for the help

Nico

Offline

#11 2019-05-28 06:43:02

Nico3939
Member
From: France
Registered: 2016-10-05
Posts: 235
Website

Re: Cart don't work (resolved)

Nico3939 wrote:
I say that because when I go to Backlight-->Top-level Galleries and View album, Cart work
But when I go to my page with embed gallery, Cart don't work

It’s been working in my testing

there is a strange thing about my installation, the version of the Backlight update module does not indicate the same version as Cart

In Backlight update module: Cart 5.0.5
In Cart 5.0.0

Capture-d-cran-2019-05-27-23-38-42.png

Capture-d-cran-2019-05-27-23-38-51.png

Offline

#12 2019-05-28 08:16:29

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Cart don't work (resolved)

Probably just an oversight


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#13 2019-05-28 08:19:01

Nico3939
Member
From: France
Registered: 2016-10-05
Posts: 235
Website

Re: Cart don't work (resolved)

probably yes

Offline

Board footer

Powered by FluxBB