Preview Hidden Products in Interspire Shopping Cart

Preview Hidden Products in Interspire Shopping Cart

Interspire Shopping Cart admins need to preview products before they go live.

Yep, we’re talking about Interspire once again today. 

The Interspire Shopping Cart doesn’t allow you to preview products that you are editing without making the product live in the store. This is plain silly; it’s vital for store owners to make sure their products pages look just as they expect when they make the product live in their store. As it is currently (in Interspire 5.5.x), this is not possible.

All it takes is one minor change in code, and your world gets a lot easier.

Mod: Preview Products That are Not Visible

Find the following code in includes/classes/class.products.php near line 126:

$query = "
	SELECT p.*, FLOOR(prodratingtotal/prodnumratings) AS prodavgrating, pi.*, ".GetProdCustomerGroupPriceSQL().",
	(SELECT COUNT(fieldid) FROM [|PREFIX|]product_customfields WHERE fieldprodid=p.productid) AS numcustomfields,
	(SELECT COUNT(reviewid) FROM [|PREFIX|]reviews WHERE revstatus='1' AND revproductid=p.productid AND revstatus='1') AS numreviews,
	(SELECT brandname FROM [|PREFIX|]brands WHERE brandid=p.prodbrandid) AS prodbrandname,
	(SELECT COUNT(imageid) FROM [|PREFIX|]product_images WHERE imageprodid=p.productid) AS numimages,
	(SELECT COUNT(discountid) FROM [|PREFIX|]product_discounts WHERE discountprodid=p.productid) AS numbulkdiscounts
	FROM [|PREFIX|]products p
	LEFT JOIN [|PREFIX|]product_images pi ON (pi.imageisthumb=1 AND p.productid=pi.imageprodid)
	WHERE ".$productSQL." AND p.prodvisible='1'
";

Replace this code with:

$query = "
	SELECT p.*, FLOOR(prodratingtotal/prodnumratings) AS prodavgrating, pi.*, ".GetProdCustomerGroupPriceSQL().",
	(SELECT COUNT(fieldid) FROM [|PREFIX|]product_customfields WHERE fieldprodid=p.productid) AS numcustomfields,
	(SELECT COUNT(reviewid) FROM [|PREFIX|]reviews WHERE revstatus='1' AND revproductid=p.productid AND revstatus='1') AS numreviews,
	(SELECT brandname FROM [|PREFIX|]brands WHERE brandid=p.prodbrandid) AS prodbrandname,
	(SELECT COUNT(imageid) FROM [|PREFIX|]product_images WHERE imageprodid=p.productid) AS numimages,
	(SELECT COUNT(discountid) FROM [|PREFIX|]product_discounts WHERE discountprodid=p.productid) AS numbulkdiscounts
	FROM [|PREFIX|]products p
	LEFT JOIN [|PREFIX|]product_images pi ON (pi.imageisthumb=1 AND p.productid=pi.imageprodid)
	WHERE ".$productSQL."
";

	// Begin View Hidden Products Mod
	if(!isset($GLOBALS['ISC_CLASS_ADMIN_AUTH'])) { $GLOBALS['ISC_CLASS_ADMIN_AUTH'] = GetClass('ISC_ADMIN_AUTH'); }
	// If the user has product editing capability, they can see the product when it's not visible on live store.
	if(!$GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Edit_Products)) {
		$query .= " AND p.prodvisible='1'";
	}
	// End View Hidden Products Mod

Now you can preview your products!

Now, any user with the permission to edit products will be able to see products that are not visible to users in the store.

These types of small changes make the Interspire Shopping Cart an even better product.

Any other things you’d like to see made possible using Interspire Shopping Cart?

Related posts:

  1. Add ‘Customers Also Purchased’ to the Cart Page on Interspire Shopping Cart
  2. How to Add an `Edit Product` Link for Interspire Shopping Cart
  3. Improve Interspire Shopping Cart Search with Smart Redirections

Comments are closed.