Category Display

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
SamsSteins
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 92
Joined: Thu Jul 10, 2008 11:43 am
Location: Lancaster PA
Contact:

Category Display

Post by SamsSteins » Thu Sep 03, 2009 3:06 pm

Is there a way to have the category display show the items images, but instead of the add to cart button the more details button shows and takes them to the product page? Or have all orders go to the cart page before checking out?

The reason for my inquiry is if a customer adds and out of stock item to their shopping cart and uses paypal or is login in and clicks the checkout now button there will never know an item is out of stock, they bypass the message on the product page and on the cart page.

Thanks.

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: Category Display

Post by AbleMods » Fri Sep 04, 2009 6:16 am

Look at my site and see if that's what you mean http://www.solunar.com

Notice that none of the category pages, featured products or recently viewed products have the Add-to-Cart button. Instead they have a "More Details" button that forces all basket additions to occur from the product page.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

SamsSteins
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 92
Joined: Thu Jul 10, 2008 11:43 am
Location: Lancaster PA
Contact:

Re: Category Display

Post by SamsSteins » Fri Sep 04, 2009 6:40 am

That is exactly what I mean. Do you sell this mod?

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: Category Display

Post by AbleMods » Fri Sep 04, 2009 7:17 am

The change is very simple - most all of the common user controls used for the visitor side reference the same add-to-cart programming code. So a single change in one user control will be reflected in many different parts of the storefront all in one swoop.

I've uploaded the modified files from a standard AC 7.0.3 installation and attached them to this post. Just backup your existing ones and replace them with these files. They go in your ~/ConLib/ folder.

You can change the "More Details" text simply by editing the text the AddToCartLink.ascx file.

Enjoy!
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

SamsSteins
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 92
Joined: Thu Jul 10, 2008 11:43 am
Location: Lancaster PA
Contact:

Re: Category Display

Post by SamsSteins » Fri Sep 04, 2009 7:50 am

It is working great - THANK YOU!!!

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: Category Display

Post by AbleMods » Fri Sep 04, 2009 8:04 am

Heh you are most welcome :)
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

seanhoward
Ensign (ENS)
Ensign (ENS)
Posts: 17
Joined: Fri Oct 02, 2009 3:01 pm

Re: Category Display

Post by seanhoward » Wed Dec 23, 2009 2:51 pm

Had this same problem, but Joe's fix didn't work for me. His fix was to force the AddToCartLink to be be visible using this line

AC.Visible = false;

In order to for the control to be visible you must actually change the property assignment to "true". However, this doesn't address the underlying problem that prevented my link from showing. Look at the primary conditional statement of the Page_PreRender event:

if ((!Token.Instance.Store.Settings.ProductPurchasingDisabled) && (product != null) && (!product.HasChoices) && (!product.DisablePurchase) && !product.UseVariablePrice)

My problem was that my product template includes a customer field. If a product "fails" any of these choices, it will show the "More Details" link instead of the "Add to Cart" link. Because my customer field is "optional", then the logic of && (!product.DisablePurchase) defeats my purpose. On the other hand, I have products with variants that I really don't want added to the cart without checking. There's even a validator that stops this from happening on the product details page. Therefore, I changed the statement to this:

if ((!Token.Instance.Store.Settings.ProductPurchasingDisabled) && (product != null) && (product.Variants.Count == 0) && (!product.DisablePurchase) && !product.UseVariablePrice)

The operative change is from this "(!product.HasChoices)" to this "(product.Variants.Count == 0)". You must also change the line

if (product.HasChoices || product.UseVariablePrice)
to
if (product.Variants.Count > 0 || product.UseVariablePrice)
in
protected void AddToCart()

This is so that the click event follows the logic of the UI display.

Post Reply