Re-Orders

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
praiseintl
Ensign (ENS)
Ensign (ENS)
Posts: 10
Joined: Fri May 21, 2010 9:56 pm

Re-Orders

Post by praiseintl » Fri May 21, 2010 10:07 pm

We have clients that will want to place the same order every month. I can not find anything for the admin to set up this feature to re-order it. Or is there the feature for customers to place re-occurring orders? Does anyone have an idea. I see it listed on the store front features page.

User avatar
Shopping Cart Admin
AbleCommerce Admin
AbleCommerce Admin
Posts: 3055
Joined: Mon Dec 01, 2003 8:41 pm
Location: Vancouver, WA
Contact:

Re: Re-Orders

Post by Shopping Cart Admin » Sat May 22, 2010 11:16 am

Hello,

On the customers orders tab in the right column is a re-order button for their last 5 orders. You could log-in as the customer via the admin > orders page, and then go here to click the button for them if needed.
Thanks for your support

Shopping Cart Guru
AbleCommerce.com
Follow us on Facebook

praiseintl
Ensign (ENS)
Ensign (ENS)
Posts: 10
Joined: Fri May 21, 2010 9:56 pm

Re: Re-Orders

Post by praiseintl » Wed Jun 02, 2010 12:34 am

If we do that, go in to their account.... Does the system automatically keep their CC on file? so it can be processed automatically when their re-order comes up?

Our customers like to place re-occuring orders that happen every month, is this the same system or do we need to do something different.

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Re-Orders

Post by mazhar » Wed Jun 02, 2010 4:54 am

I guess you are asking about subscriptions feature. Have a look at subscriptions section, those are used for recurring billing.

User avatar
triplw
Commander (CMDR)
Commander (CMDR)
Posts: 144
Joined: Sat Jan 12, 2008 5:34 pm
Contact:

Re: Re-Orders

Post by triplw » Fri Jun 04, 2010 12:36 pm

I added a reorder feature to Admin by adding to /ViewOrder.aspx.cs. It makes an option in the Tasks dropdown.

In this method add another case:

Code: Select all

protected void OrderActionButton_Click(object sender, ImageClickEventArgs e)
{
........................

                case "REORDER":
                    Reorder();
                    Response.Redirect("Create/CreateOrder3.aspx?UID=" + _Order.UserId.ToString());
                    break;
.........................
}
Then add a reorder method:

Code: Select all

protected void Reorder()
    { 
        BasketItem basketItem = null;
        List<string> basketMessages = new List<string>();
        Basket basket = _Order.User.Basket;
        basket.Clear();
        foreach (OrderItem item in _Order.Items)
        {
            if ((item.OrderItemType == OrderItemType.Product) && (!item.IsChildItem))
            {
                Product product = item.Product;
                if ((product != null) && (product.Visibility != CommerceBuilder.Catalog.CatalogVisibility.Private))
                {                 
                    try
                    {
                        basketItem = BasketItemDataSource.CreateForProduct(item.ProductId, item.Quantity, item.OptionList, item.KitList);
                    }
                    catch
                    {
                        string itemName = item.Name;
                        if (!string.IsNullOrEmpty(item.VariantName)) itemName += " (" + item.VariantName + ")";
                        basketMessages.Add("The item " + itemName + " is no longer available.");
                        basketItem = null;
                    }
                    if (basketItem != null)
                    {
                        //SEE IF A PRODUCT TEMPLATE IS ASSOCIATED
                        ProductTemplate template = product.ProductTemplate;
                        if (template != null)
                        {
                            foreach (InputField inputField in template.InputFields)
                            {
                                if (!inputField.IsMerchantField)
                                {
                                    //COPY OVER ANY CUSTOMER INPUTS
                                    BasketItemInput itemInput = new BasketItemInput();
                                    itemInput.InputFieldId = inputField.InputFieldId;
                                    itemInput.InputValue = GetItemInputValue(item, inputField.Name);
                                    basketItem.Inputs.Add(itemInput);
                                }
                            }
                        }
                    }
                }
                if ((basketItem.OrderItemType == OrderItemType.Product) && (basketItem.Product.UseVariablePrice)) basketItem.Price = item.Price;
                basket.Items.Add(basketItem);
                //WE HAVE TO SAVE THE BASKET IN CASE IT IS NOT YET CREATED
                basket.Save();
            }

        }
    }

Thistle3408
Lieutenant (LT)
Lieutenant (LT)
Posts: 77
Joined: Mon Apr 19, 2010 4:52 pm

Re: Re-Orders

Post by Thistle3408 » Sat Jun 05, 2010 7:29 am

triplw

Getting an error trying to use the code you suggested.
See below.




Server Error in '/' Application.

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0246: The type or namespace name 'Product' could not be found (are you missing a using directive or an assembly reference?)

Source Error:


Line 501: if ((item.OrderItemType == OrderItemType.Product) && (!item.IsChildItem))
Line 502: {
Line 503: Product product = item.Product;
Line 504: if ((product != null) && (product.Visibility != CommerceBuilder.Catalog.CatalogVisibility.Private))
Line 505: {

Source File: c:\inetpub\wwwroot\netgate\Admin\Orders\ViewOrder.aspx.cs Line: 503

User avatar
triplw
Commander (CMDR)
Commander (CMDR)
Posts: 144
Joined: Sat Jan 12, 2008 5:34 pm
Contact:

Re: Re-Orders

Post by triplw » Sat Jun 05, 2010 4:49 pm

Do you have:

Code: Select all

using CommerceBuilder.Products;
as a reference at the top of the page?

Thistle3408
Lieutenant (LT)
Lieutenant (LT)
Posts: 77
Joined: Mon Apr 19, 2010 4:52 pm

Re: Re-Orders

Post by Thistle3408 » Thu Jul 08, 2010 12:18 pm

Do I need a reference to get the "producttemplate" to compile correctly.
I'm sorry I haven't been able to get to this for a month.

I'm getting a compiler error on the following line:
ProductTemplate template = product.ProductTemplate;

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Re-Orders

Post by mazhar » Fri Jul 09, 2010 5:10 am

The reason is that in 7.0.4 one product can have more then one product templates. I guess you are using an old statement where only one product template could be applied on a product. This is no more valid in 7.0.4. You need to update following code

Code: Select all

//SEE IF A PRODUCT TEMPLATE IS ASSOCIATED
                        ProductTemplate template = product.ProductTemplate;
                        if (template != null)
                        {
                            foreach (InputField inputField in template.InputFields)
                            {
                                if (!inputField.IsMerchantField)
                                {
                                    //COPY OVER ANY CUSTOMER INPUTS
                                    BasketItemInput itemInput = new BasketItemInput();
                                    itemInput.InputFieldId = inputField.InputFieldId;
                                    itemInput.InputValue = GetItemInputValue(item, inputField.Name);
                                    basketItem.Inputs.Add(itemInput);
                                }
                            }
                        }
with

Code: Select all

//SEE IF A PRODUCT TEMPLATE IS ASSOCIATED
        foreach (ProductProductTemplate ppt in product.ProductProductTemplates)
        {
            ProductTemplate template = ppt.ProductTemplate;
            if (template != null)
            {
                foreach (InputField inputField in template.InputFields)
                {
                    if (!inputField.IsMerchantField)
                    {
                        //COPY OVER ANY CUSTOMER INPUTS
                        BasketItemInput itemInput = new BasketItemInput();
                        itemInput.InputFieldId = inputField.InputFieldId;
                        itemInput.InputValue = GetItemInputValue(item, inputField.Name);
                        basketItem.Inputs.Add(itemInput);
                    }
                }
            }
        }

Thistle3408
Lieutenant (LT)
Lieutenant (LT)
Posts: 77
Joined: Mon Apr 19, 2010 4:52 pm

Re: Re-Orders

Post by Thistle3408 » Fri Jul 09, 2010 5:46 am

Hum, yet another gotcha... what's the fix to this error?

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0103: The name 'GetItemInputValue' does not exist in the current context

Source Error:


Line 519: BasketItemInput itemInput = new BasketItemInput();
Line 520: itemInput.InputFieldId = inputField.InputFieldId;
Line 521: itemInput.InputValue = GetItemInputValue(item, inputField.Name);
Line 522: basketItem.Inputs.Add(itemInput);
Line 523: }

Source File: c:\inetpub\wwwroot\netgate\Admin\Orders\ViewOrder.aspx.cs Line: 521

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Re-Orders

Post by mazhar » Fri Jul 09, 2010 6:12 am

try replacing following line

Code: Select all

itemInput.InputValue = GetItemInputValue(item, inputField.Name);
with

Code: Select all

string value = string.Empty;
                                    foreach (OrderItemInput oii in item.Inputs)
                                    {
                                        if (oii.Name == inputField.Name)
                                        {
                                            value = oii.InputValue;
                                            break;
                                        }
                                    }

                                    itemInput.InputValue = value;

praiseintl
Ensign (ENS)
Ensign (ENS)
Posts: 10
Joined: Fri May 21, 2010 9:56 pm

Re: Re-Orders

Post by praiseintl » Wed Jul 14, 2010 1:22 am

Mazhar,

Not sure if I am placing the code in the correct spots or pages. I added the code above from you & triplw. But to no avail. I am new to editing this and not sure if I should do through the admin -website - content and layout - or through FTP...

Help?

praiseintl
Ensign (ENS)
Ensign (ENS)
Posts: 10
Joined: Fri May 21, 2010 9:56 pm

Re: Re-Orders

Post by praiseintl » Wed Jul 14, 2010 1:31 am

triplw,

can you let me know where to look on your site to view the re-order process.

Here is what I am trying to do.

1) A customer orders a product for the first time.
2) They can create an order that is the same and will auto generate every ?? days, weeks or months.
3) So every (lets say 30 days) we get an order and then ship it to the customer.
4) Their CC is charged automatically through the gateway...

Does this help?

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Re-Orders

Post by mazhar » Wed Jul 14, 2010 4:06 am

I guess you are looking for subscriptions functionality. Look into subscriptions feature in AbleCommerce for recurring.

praiseintl
Ensign (ENS)
Ensign (ENS)
Posts: 10
Joined: Fri May 21, 2010 9:56 pm

Re: Re-Orders

Post by praiseintl » Fri Jul 16, 2010 2:49 pm

We need to create recurring orders of a product with options and recurring period chosen by an individual customer. We want them to be able to say: "Ship me a 1-pound bag of French Roast coffee, fine grind, every week, and bill me weekly until I tell you to stop".

I see the flow as something like:

- customer selects an item with a weekly or monthly delivery option (Your sales rep had me set this up in a kit form, where the weekly and monthly subscriptions were parts in a kit -- the UI looks perfect)
- customer submits order through storefront
- storefront passes recurring billing task to processsor
- the processor's recurring billing service lets the storefront know when the next payment has been processed -- we could do a daily manual import, but it would be great if it was automated
- storefront creates a new order corresponding to the new payment
- order appears in the storefront's list of orders to be processed and shipped


1. Can a saved credit card on a purchase can be used as saved payment method unique to the customer for initiating manually placed future orders out of Able Commerce by either a client or as customer service rep to reorder product since the subscription option has only 1 time value?
2. Can we could query the backside of the database for the credit card number using the HASH and ENCRYPT key?
3. Do you have an off-the-shelf to CIM of Authorize.net yet instead of just AIM?

fcmlmt1
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 26
Joined: Tue Jul 21, 2009 11:34 am

Re: Re-Orders

Post by fcmlmt1 » Tue Sep 21, 2010 11:40 am

I'm interested in doing this same type of thing:

Here is what I am trying to do.

1) A customer orders a product for the first time.
2) They can create an order that is the same and will auto generate every ?? days, weeks or months.
3) So every (lets say 30 days) we get an order and then ship it to the customer.
4) Their CC is charged automatically through the gateway...

I looked at the subscription option however it does not create a shipping invoice that is placed in the "shipment pending" status so we can ship the product. Does this happen in a future upgrade? I'm currently using 7.0.3. I'm really interested on how to make this work.

AnyaJohn
Ensign (ENS)
Ensign (ENS)
Posts: 1
Joined: Mon Sep 27, 2010 4:18 am

Re: Re-Orders

Post by AnyaJohn » Mon Sep 27, 2010 4:23 am

I'm getting a compiler error on the following line:
ProductTemplate template = product.ProductTemplate;
can anybody help me to solve it?

[url="http://www.padana.com/"]Bomber Leather Jackets[/url]

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Re-Orders

Post by mazhar » Mon Sep 27, 2010 4:34 am

AnyaJohn wrote:I'm getting a compiler error on the following line:
ProductTemplate template = product.ProductTemplate;
can anybody help me to solve it?

[url="http://www.padana.com/"]Bomber Leather Jackets[/url]
Its because in 7.0.4 we changed the way products template are coded. Now more then one product templates could be used with a product. Read following comment. viewtopic.php?f=42&t=13710#p59800

fcmlmt1
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 26
Joined: Tue Jul 21, 2009 11:34 am

Re: Re-Orders

Post by fcmlmt1 » Tue Oct 05, 2010 1:03 pm

Is this possible with 7.4
Here is what I am trying to do.

1) A customer orders a product for the first time.
2) They can create an order that is the same and will auto generate every ?? days, weeks or months.
3) So every (lets say 30 days) we get an order and then ship it to the customer.
4) Their CC is charged automatically through the gateway...

I looked at the subscription option however it does not create a shipping invoice that is placed in the "shipment pending" status so we can ship the product. Does this happen in a future upgrade? I'm currently using 7.0.3. I'm really interested on how to make this work.

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Re-Orders

Post by mazhar » Wed Oct 06, 2010 4:13 am

2) They can create an order that is the same and will auto generate every ?? days, weeks or months.
Well at the moment AbleCommerce doesn't create automatic orders for subscription. You may be required to do some custom coding to accomplish this. For example may be running some order creation routine against a trimmed event. See following link for more details about custom timed event
http://wiki.ablecommerce.com/index.php/ ... med_Events
4) Their CC is charged automatically through the gateway...
I think this depends upon your payment provider account. You need to place an order of type subscription and then tell payment provider that these are subscription charges and they need to capture it on recurring bases after certain period.

Post Reply