Mailing List Archive

Load saved cart (but don't clobber)
Can I have the saved shopping cart associated with a user's account
loaded when they log in but combined with the current cart contents
instead of clobbering it?

- Grant

_______________________________________________
interchange-users mailing list
interchange-users@icdevgroup.org
http://www.icdevgroup.org/mailman/listinfo/interchange-users
Re: Load saved cart (but don't clobber) [ In reply to ]
> Can I have the saved shopping cart associated with a user's account
> loaded when they log in but combined with the current cart contents
> instead of clobbering it?


Can anyone tell me where in the IC core the logic should be written to
implement a functionality change like this?

- Grant

_______________________________________________
interchange-users mailing list
interchange-users@icdevgroup.org
http://www.icdevgroup.org/mailman/listinfo/interchange-users
Re: Load saved cart (but don't clobber) [ In reply to ]
On 12/17/2015 04:08 PM, Grant wrote:
>> Can I have the saved shopping cart associated with a user's account
>> loaded when they log in but combined with the current cart contents
>> instead of clobbering it?
>
>
> Can anyone tell me where in the IC core the logic should be written to
> implement a functionality change like this?

I'm sure we have some code for merging carts / products in cart in
WellWell and Interchange 6.

In Interchange 5 you can manipulate $Items resp. $Carts - no need
for core hacking.

Regards
Racke

--
Perl and Dancer Development

Visit our Perl::Dancer conference 2015.
More information on https://www.perl.dance.


_______________________________________________
interchange-users mailing list
interchange-users@icdevgroup.org
http://www.icdevgroup.org/mailman/listinfo/interchange-users
Re: Load saved cart (but don't clobber) [ In reply to ]
> On Dec 17, 2015, at 10:14 AM, Stefan Hornburg (Racke) <racke@linuxia.de> wrote:
>
> On 12/17/2015 04:08 PM, Grant wrote:
>>> Can I have the saved shopping cart associated with a user's account
>>> loaded when they log in but combined with the current cart contents
>>> instead of clobbering it?
>>
>>
>> Can anyone tell me where in the IC core the logic should be written to
>> implement a functionality change like this?
>
> I'm sure we have some code for merging carts / products in cart in
> WellWell and Interchange 6.
>
> In Interchange 5 you can manipulate $Items resp. $Carts - no need
> for core hacking.
What’s WellWell?

-Bill Carr
_______________________________________________
interchange-users mailing list
interchange-users@icdevgroup.org
http://www.icdevgroup.org/mailman/listinfo/interchange-users
Re: Load saved cart (but don't clobber) [ In reply to ]
On 12/17/2015 04:21 PM, William Carr wrote:
>
>> On Dec 17, 2015, at 10:14 AM, Stefan Hornburg (Racke) <racke@linuxia.de> wrote:
>>
>> On 12/17/2015 04:08 PM, Grant wrote:
>>>> Can I have the saved shopping cart associated with a user's account
>>>> loaded when they log in but combined with the current cart contents
>>>> instead of clobbering it?
>>>
>>>
>>> Can anyone tell me where in the IC core the logic should be written to
>>> implement a functionality change like this?
>>
>> I'm sure we have some code for merging carts / products in cart in
>> WellWell and Interchange 6.
>>
>> In Interchange 5 you can manipulate $Items resp. $Carts - no need
>> for core hacking.
> What’s WellWell?
>

My reckless try for Interchange 5 sanity ... includes sound component
logic, support for other template engines (somehow), database backed
carts etc.

You find it on GitHub.

Regards
Racke



--
Perl and Dancer Development

Visit our Perl::Dancer conference 2015.
More information on https://www.perl.dance.


_______________________________________________
interchange-users mailing list
interchange-users@icdevgroup.org
http://www.icdevgroup.org/mailman/listinfo/interchange-users
Re: Load saved cart (but don't clobber) [ In reply to ]
>>> Can I have the saved shopping cart associated with a user's account
>>> loaded when they log in but combined with the current cart contents
>>> instead of clobbering it?
>>
>>
>> Can anyone tell me where in the IC core the logic should be written to
>> implement a functionality change like this?
>
> I'm sure we have some code for merging carts / products in cart in
> WellWell and Interchange 6.
>
> In Interchange 5 you can manipulate $Items resp. $Carts - no need
> for core hacking.


How can I manipulate the functionality that loads a user's previous
shopping cart from the array saved in the userdb without hacking the
core? Maybe you mean I should disable that functionality and rewrite
it outside of the core?

- Grant

_______________________________________________
interchange-users mailing list
interchange-users@icdevgroup.org
http://www.icdevgroup.org/mailman/listinfo/interchange-users
Re: Load saved cart (but don't clobber) [ In reply to ]
On 16/12/15 07:39, Grant wrote:
> Can I have the saved shopping cart associated with a user's account
> loaded when they log in but combined with the current cart contents
> instead of clobbering it?

Just put in a postlogin_action that calls the [load-cart] tag, it
already merges by default, something like this in catalog.cfg should do
it I think (untested):

UserDB default postlogin_action [load-cart]


Peter

_______________________________________________
interchange-users mailing list
interchange-users@icdevgroup.org
http://www.icdevgroup.org/mailman/listinfo/interchange-users
Re: Load saved cart (but don't clobber) [ In reply to ]
>> Can I have the saved shopping cart associated with a user's account
>> loaded when they log in but combined with the current cart contents
>> instead of clobbering it?
>
> Just put in a postlogin_action that calls the [load-cart] tag, it
> already merges by default, something like this in catalog.cfg should do
> it I think (untested):
>
> UserDB default postlogin_action [load-cart]


I switched from this:

[userdb function=get_cart nickname=shopping_cart]

to this:

[load-cart name=shopping_cart]

and it's merging but if the same item is in the current cart and
loaded from the saved cart then they end up as separate line items.
Can I have them either de-duplicated or incremented in quantity on the
same line?

- Grant

_______________________________________________
interchange-users mailing list
interchange-users@icdevgroup.org
http://www.icdevgroup.org/mailman/listinfo/interchange-users
Re: Load saved cart (but don't clobber) [ In reply to ]
>>> Can I have the saved shopping cart associated with a user's account
>>> loaded when they log in but combined with the current cart contents
>>> instead of clobbering it?
>>
>> Just put in a postlogin_action that calls the [load-cart] tag, it
>> already merges by default, something like this in catalog.cfg should do
>> it I think (untested):
>>
>> UserDB default postlogin_action [load-cart]
>
>
> I switched from this:
>
> [userdb function=get_cart nickname=shopping_cart]
>
> to this:
>
> [load-cart name=shopping_cart]
>
> and it's merging but if the same item is in the current cart and
> loaded from the saved cart then they end up as separate line items.
> Can I have them either de-duplicated or incremented in quantity on the
> same line?


Isn't there a catalog config line for this? I can't remember what it's called.

- Grant

_______________________________________________
interchange-users mailing list
interchange-users@icdevgroup.org
http://www.icdevgroup.org/mailman/listinfo/interchange-users
Re: Load saved cart (but don't clobber) [ In reply to ]
On 22/12/15 04:16, Grant wrote:
>>> Can I have the saved shopping cart associated with a user's account
>>> loaded when they log in but combined with the current cart contents
>>> instead of clobbering it?
>>
>> Just put in a postlogin_action that calls the [load-cart] tag, it
>> already merges by default, something like this in catalog.cfg should do
>> it I think (untested):
>>
>> UserDB default postlogin_action [load-cart]
>
>
> I switched from this:
>
> [userdb function=get_cart nickname=shopping_cart]
>
> to this:
>
> [load-cart name=shopping_cart]
>
> and it's merging but if the same item is in the current cart and
> loaded from the saved cart then they end up as separate line items.
> Can I have them either de-duplicated or incremented in quantity on the
> same line?

after the [load-cart] tag you would put in a [calcn] block that iterates
over the $Items hashref comparing the items and merging them
individually. Just tweak the quantity field, adding on one item and
zeroing on the other, then you can toss cart which will remove all the
items with 0 quantity.


Peter

_______________________________________________
interchange-users mailing list
interchange-users@icdevgroup.org
http://www.icdevgroup.org/mailman/listinfo/interchange-users
Re: Load saved cart (but don't clobber) [ In reply to ]
On Wed, 23 Dec 2015 06:15:31 -0800
Grant <emailgrant@gmail.com> wrote:

> >>> Can I have the saved shopping cart associated with a user's
> >>> account loaded when they log in but combined with the current
> >>> cart contents instead of clobbering it?
> >>
> >> Just put in a postlogin_action that calls the [load-cart] tag, it
> >> already merges by default, something like this in catalog.cfg
> >> should do it I think (untested):
> >>
> >> UserDB default postlogin_action [load-cart]
> >
> >
> > I switched from this:
> >
> > [userdb function=get_cart nickname=shopping_cart]
> >
> > to this:
> >
> > [load-cart name=shopping_cart]
> >
> > and it's merging but if the same item is in the current cart and
> > loaded from the saved cart then they end up as separate line items.
> > Can I have them either de-duplicated or incremented in quantity on
> > the same line?
>
>
> Isn't there a catalog config line for this? I can't remember what
> it's called.

SeparateItems No

Regards
Racke


--
Perl and Dancer Development

Visit our Perl::Dancer conference 2015.
More information on https://www.perl.dance.


_______________________________________________
interchange-users mailing list
interchange-users@icdevgroup.org
http://www.icdevgroup.org/mailman/listinfo/interchange-users
Re: Load saved cart (but don't clobber) [ In reply to ]
>> >>> Can I have the saved shopping cart associated with a user's
>> >>> account loaded when they log in but combined with the current
>> >>> cart contents instead of clobbering it?
>> >>
>> >> Just put in a postlogin_action that calls the [load-cart] tag, it
>> >> already merges by default, something like this in catalog.cfg
>> >> should do it I think (untested):
>> >>
>> >> UserDB default postlogin_action [load-cart]
>> >
>> >
>> > I switched from this:
>> >
>> > [userdb function=get_cart nickname=shopping_cart]
>> >
>> > to this:
>> >
>> > [load-cart name=shopping_cart]
>> >
>> > and it's merging but if the same item is in the current cart and
>> > loaded from the saved cart then they end up as separate line items.
>> > Can I have them either de-duplicated or incremented in quantity on
>> > the same line?
>>
>>
>> Isn't there a catalog config line for this? I can't remember what
>> it's called.
>
> SeparateItems No


I do have that configured. Should that be a bug?

- Grant

_______________________________________________
interchange-users mailing list
interchange-users@icdevgroup.org
http://www.icdevgroup.org/mailman/listinfo/interchange-users