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?

  • seo

    thanks for information

  • Steve

    How do you set up an account that lets this mod work?

  • sam

    thanx for the mod! this should have been already in the software from the get-go. a nice mod to see would be to have certain products that only certain customers can view. currently the only way to do that is to restrict seen categories based on customers who create an account and not everyone automatically.

    so if a customer is a repeat customer or at a reseller level or the like then it would be nice to have products available that only they can see such as seasonal products, certain options, specials and other items not available to everyone who comes to the site. not sure how this can be done but would be nice!

  • Miguel

    Hi there
    Thank you for this mod. I have added the code but don’t see where to preview the items. Can you assist?

    Thanks

  • Kenn

    the ability to export the results of a custom date range search!!!