You are here:  » Price strp menu within product pages

Support Forum



Price strp menu within product pages

Submitted by Paul1107 on Mon, 2009-12-28 20:14 in

Hi David,

Hope you had a great Christams!

I hope this doesn't task you too much, and on the face of it I thought it should work, but can't get it to???

I am working in wordpress, and proveiously when I had wanted to create price breaks view into a product page or low to high view (and vice versa), I have had to create a page template for each resulting page, which is time comsuming.

I thought there may be a way to dynamically change the info by creating one template page and say an include folder in my site root and then calling each page via a variable

At the moment my template page looks something like this with the calling code included

<?php
/*
Template Name: womens dresses
*/
?>
<?php get_header(); ?>
<div id="content">
<div id="contentleft">
<div class="postarea">
<?php include(TEMPLATEPATH."/breadcrumb.php");?>
<?php
echo "<div style='clear:both;'></div>";
echo "<h1>Body Con Dresses</h1>";
  ?>
<?php if (!$_GET["product"]): ?>
<div id="pricehi-lo"><a href="http://localhost/wordpress/womens-dresses-asc/">Price - Low to High</a></div><br/>
<?php endif; ?>
<?php
 $external_baseHREF = "http://localhost/mystore/";
 $external_path = "C:/xampp/htdocs/mystore/";
 if (!$_GET["q"] && !$_GET["r"] && !$_GET["merchant"])
 {
   $_GET["q"] = "%dress%";
   $_GET["sort"] = "priceDesc";
   $_GET["maxPrice"] = "1000";
  $_GET["minPrice"] = "20";
 }
 require($external_path."external.php");
?>
</div>
</div>
<?php include(TEMPLATEPATH."/sidebar.php");?>
</div>
<!-- The main column ends -->
<?php get_footer(); ?>

I was playing around with something like below, but it wasn't working

a href='?page=under30'>Under £30 |
a href='?page=30-50'>£30-£50 |
a href='?page=50-100'>£50-£100 |
a href='?page=100-200'>£100-£200 |
a href='?page=over200'>Over £200 |
a href='?page=dresses_Asc'>Low to High |
a href='womens_dresses.php'>High to Low

<?php
$page 
$_GET['page'];
if (
$page)
{
    include (
"inc/".$page.".php");
}
else
{
       echo 
"include('inc/womens_dresses.php')";
}
?>

Is this completely off the mark?

Regards

Paul

Submitted by support on Tue, 2009-12-29 10:50

Hi Paul,

It's not far off... Could you perhaps email me your template page containing the calling code, and your external.php and I'll check it out for you. It can probably be all combined into a single page whereby you propagate the min / max price and sort parameters into the URL rather than loading duplicate pages...

Cheers,
David.