Jump to content

AJStevens

Members
  • Content count

    16
  • Joined

  • Last visited

  1. AJStevens

    [contribution] Simple Template System (sts)

    How can I get popup_search_help.php to not only use infobox_header.php.html but also sts_template.html and the new stylesheet location? Also, the sts_debug doesn't work on this page. Update: Actually, it's only replacing the images, it's not actually fully listening to the infobox_header.php.html file as the td's and tr's don't match the others. So, it's only picking up that there are new images and using them instead of the default ones (same name), it's not actually applying a template or templates to it. I suppose I need to poke around in sts and sts_inc?
  2. AJStevens

    [contribution] Simple Template System (sts)

    Also, rather more urgently, we're setting up a payment method using the ePDQ module, it's important that on the checkout_confirmation.php the button for Confirm Order points to https://secure2.epdq.co.uk/cgi-bin/CcxBarclaysEpdq.e however, the referrer should be just http://.../checkout_confirmation.php but instead it has the ?OscSid=whatever on the end, it must not add that to the end. Is this because of STS? Is there a way round it?
  3. AJStevens

    [contribution] Simple Template System (sts)

    A colleague of mine has pointed out our formatting is not right on a hidden page. Click Advanced Search, then the "Search Help [?]" hyperlink to get a small page popup_search_help.php Interestingly... it seems to pick up on my infobox_header.php.html for the corner images ok. However it's getting the default stylesheet, instead of the one I put in the folder, which I call in sts_template.html using <link rel="stylesheet" type="text/css" href="$templatedir/stylesheet.css">. Anyone else experienced this? I need a fix asap please.
  4. AJStevens

    [contribution] Simple Template System (sts)

    Yep, thanks. Of course when you've got a deadline, it'll due. Plus, I'm the technical side of the site, the appearance is down to another, and since we don't get any feedback from management until something is up there, it's all we can go on. Later on, for the next template, may get a bit wild with DIVs or whatever you and others suggest.
  5. AJStevens

    [contribution] Simple Template System (sts)

    $templatedir does not seem to work fully, at the moment I have the following templates: sts_template.html infobox.php.html infobox_header.php.html infobox_categories_header.php.html infobox_new_products_header.php.html infobox_shopping_cart_header.php.html Essentially, the main ones are sts_template.html infobox.php.html infobox_header.php.html I have the following to adjust the corner images (much like the original OSC) infobox_categories_header.php.html infobox_new_products_header.php.html infobox_shopping_cart_header.php.html I'm trying to use $templatedir instead of includes/sts_templates/template1 for SRC of images, however it appears to only work some of the time. On the index page: infobox_categories_header.php.html (should be using infobox_categories_header.php.html) - Works fine Manufacturers (should be using infobox_header.php.html) - Works fine Quick Find (should be using infobox_header.php.html) - Does NOT work Information (should be using infobox_header.php.html) - Works fine New Products for Month (should be using infobox_new_products_header.php.html) - Does NOT work Shoppnig Cart (should be using infobox_shopping_cart_header.php.html) - Does NOT work Best Sellers (should be using infobox_header.php.html) - Works fine Instead of it replacing $templatedir with includes/sts_templates/templatename I see http://www.site.com/catalog/$templatedir/images/infobox/corner_left.gif when it should be http://www.site.com/catalog/includes/sts_templates/templatename/images/infobox/corner_left.gif I'm also using $templatedir to point to the stylesheet, instead of the one at the catalog root, in the template and that works fine. Anyone else experienced this? I'd rather use $templatedir so it's easier to make lots of templates quickly.
  6. AJStevens

    [contribution] Simple Template System (sts)

    burt, No, without STS installed, the tablebox function is suitable to be used, it takes the headertext and adds the corner images (doing some checks for which corner image file should be used). However, after you install STS, STS still uses the OSC tablebox function before then passing it to the template, pointless, as it does not add the corner images (that's left to the template) so you just get the headertext wrapped in a table before passed to the STS template.
  7. AJStevens

    Information Pages Unlimited v1.0

    nevermind, found it. information_form.php Line 90 - Missnig the % in the width="100" <td valign="top" class="main" width="100" colspan="2"><?php if ($i == 0) echo ENTRY_DESCRIPTION; ?><p /> So it should be <td valign="top" class="main" width="100%" colspan="2"><?php if ($i == 0) echo ENTRY_DESCRIPTION; ?><p />
  8. AJStevens

    Information Pages Unlimited v1.0

    Installed the latest version of IP, and fckeditor, and when I go to edit any of the items, my fck editor is very squashed, has anyone else had this problem? How can I correct it please?
  9. AJStevens

    [contribution] Simple Template System (sts)

    I have made a infobox_new_products template, I had to along with categories and shopping cart to recreate the different corner images used, I then set the main infobox template to use square corners (as most of the others do). However, because of this table the header for New Products is too high and the corner images no longer line up with the header correctly. One other fix is to increase the height of the images from 14 to 16, however the header for New Products looks taller than the others. If I did create a contribution, it would primarily be just a few html files to go into a subfolder of the sts_templates folder. The modification to the boxes.php file makes perfect sense to me, and while my code may not be the norm (I was trying to pull it out of the array it had been inserted into a little further up but gave up working out the syntax) however, as I have said, why would STS use OSC code to wrap a line of text in a table attribute it does not need, STS is based on using the templates. I'm still not sure you understand what we mean, perhaps a sample of my index page now that I've made the change: <td><!-- new_products //--> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td height="14" class="infoBoxHeading"><img border="0" src="images/infobox/corner_left.gif" width="11" height="14"></td> <td width="100%" height="14" class="infoBoxHeading">[b]New Products For April[/b]</td> <td width="92" style="background-repeat: norepeat" bgcolor="#BBC3D3"></td> <td width="11"><img border="0" src="images/infobox/corner_right_left.gif" width="11" height="14"></td> </tr> </table> <table border="0" width="100%" cellspacing="0" cellpadding="1" class="infoBox"> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0" class="infoBoxContents"> <tr> <td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="1"></td> </tr> <tr> <td class="infoBoxContents" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> Compare that to what you get with the Full or Test of a brand new STS install which is: <td><!-- new_products //--> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td height="14" class="infoBoxHeading"><img border="0" src="images/infobox/corner_left.gif" width="11" height="14"></td> <td width="100%" height="14" class="infoBoxHeading">[b]<table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="infoBoxHeading" width="100%">New Products For April</td> </tr> </table>[/b]</td> <td width="92" style="background-repeat: norepeat" bgcolor="#BBC3D3"></td> <td width="11"><img border="0" src="images/infobox/corner_right_left.gif" width="11" height="14"></td> </tr> </table> <table border="0" width="100%" cellspacing="0" cellpadding="1" class="infoBox"> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0" class="infoBoxContents"> <tr> <td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="1"></td> </tr> <tr> <td class="infoBoxContents" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> Have bolden for comparison. Granted this is not noticeable on most of the infobox headings, but it is definately noticeable on the New Products For ... on the index, and as anyone creates their own infobox tempates, their layouts could be thrown out by this unnecessary table (reviewing this thread, I see other raising this issue, in different ways). Hence in the next version of STS, my fix (maybe using the array than the content[0]['text'] that I had to, or whatever, as long as it's not using tablebox, doesn't need to) should be applied.
  10. AJStevens

    [contribution] Simple Template System (sts)

    I just didn't want the table it wraps around the headertext, which is sourced from the different language files, and some contain non-static information (such as "New Products for %s" on the index page), why should I have to write custom code for that when it's already done by $headertext Yes, I realise I could have images and whatever I want on a per template basis, but if I did use text, I get it wrapped in a table, and this can disrupt the template (since heaaders are normally small areas, the standard OSC is anyway). This is particularly noticeable when someone installs STS, then looks at it and thinks "It doesn't look like OSC did before it, the colours are wrong, and the New Products header just looks wrong". I realise the point of STS is to make your site look different to the default OSC, however, I doubt I'm the only to have spent time first just getting it to look like the normal OSC to create a "default" template, before then moving on to come up with their own idea. Particularly due to the blue colour of the New Products section on the index, the New Products header completely off (which the cause seems to be this $headertext including another table), the coloured area for when the right arrow is not present not matching. I might save my files, with the boxes.php modification and add it to the contribution or powerpack, "Default OSC 2.2 RC2a Template for STS" Of course, the $headertext wrapped in a table won't only affect creating a perfect default template, but any other templates users make that use the unmodified $headertext in their own templates (with their own layouts of tables, DIVs or whatever). What logic is there in $headertext not only being text but containing a table too? The layout should be controlled by the template files, if it was just $header fine, like $content i could mean anything. I've not gotten to Custom STS placeholders yet, however I will look into them for future items, but again surely $headertext should be text, the table is pointless, the tablebox function is used in the original OSC (or when sts is disabled) and takes multiple colums (corner images and the header text) and turns it into a table for the header. However, STS uses the template file to handle the corner images and right arrow, so the $headertext wrapped in a table is superfluous. It would also be nice if a singel template could have code in it to work out different images for different parts, rather than having to make more template files, just to have a rounded corner on a particular side. I still feel the tableBox should be removed from that line of code in the boxes.php, why is it still using part of the original OSC code, in the if STS enabled section?
  11. AJStevens

    [contribution] Simple Template System (sts)

    No bkellum you are missing the point of my post, I know full well what the point of the infobox templates, I'm using it! My point is, on the ones I've created, my layout is being messed up because $headertext is not simple a line of text for the heading, but also a table element, a table element not needed (I'll decide what table elements or whatever will be using the infobox.php.html file). I had to edit the boxes.php file, because before it sends headertext to the sts template system, it first sends it to the tablebox function, which just wraps it in the unnecessary table. My change in a previous post removes this step and should only effect the header.
  12. AJStevens

    [contribution] Simple Template System (sts)

    A little more fiddling, and I think I've found it. Includes/classes/boxes.php (the one STS give you). Look for this section of code , should be lines 233 - 260: class contentBoxHeading extends tableBox { function contentBoxHeading($contents) { // START STS global $sts; if ($sts->infobox_enabled == true) { $info_box_contents = array(); $info_box_contents[] = array(array('params' => 'class="infoBoxHeading" width="100%"', 'text' => $contents[0]['text'])); $this->infoBoxHeaderTemplate($this->tablebox($info_box_contents),$right_arrow); } else { $this->table_width = '100%'; $this->table_cellpadding = '0'; $info_box_contents = array(); $info_box_contents[] = array(array('params' => 'height="14" class="infoBoxHeading"', 'text' => tep_image(DIR_WS_IMAGES . 'infobox/corner_left.gif')), array('params' => 'height="14" class="infoBoxHeading" width="100%"', 'text' => $contents[0]['text']), array('params' => 'height="14" class="infoBoxHeading"', 'text' => tep_image(DIR_WS_IMAGES . 'infobox/corner_right_left.gif'))); $this->tableBox($info_box_contents, true); } // END STS } } Replace line 243: $this->infoBoxHeaderTemplate($this->tablebox($info_box_contents),$right_arrow); With: $this->infoBoxHeaderTemplate($contents[0]['text'],$right_arrow); This should only affect the headings, and as far as I see doesn't upset anything else. Please correct me if I'm wrong.
  13. AJStevens

    [contribution] Simple Template System (sts)

    I've got a slight issue with STS and the Infoboxes. I notice that the $headertext placeholder returns not just the header text for the infobox. Instead I'm getting this on the new products on the home page (example): <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="infoBoxHeading" width="100%">New Products For April</td> </tr> </table> I was expecting just to get "New Products For April" and can then use my templates to sort out the layout around it. I've tried following it through the code, but I get lost before I can find where $headertext is set to the above.
  14. AJStevens

    Seperate Pricing Per Customer v3.5

    To further eleborate. catalog/includes/modules/new_products.php Line 21-34 **REPLACE** if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) { // BOF Separate Pricing per Customer $new_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, p.products_price as products_price from " . TABLE_PRODUCTS . " p where products_status = '1' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS); } else { $new_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, p.products_price as products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' order by p.products_date_added desc limit ". MAX_DISPLAY_NEW_PRODUCTS); } // global variable (session) $sppc_customer_group_id -> local variable customer_group_id if(!tep_session_is_registered('sppc_customer_group_id')) { $customer_group_id = '0'; } else { $customer_group_id = $sppc_customer_group_id; } **WITH** // global variable (session) $sppc_customer_group_id -> local variable customer_group_id if(!tep_session_is_registered('sppc_customer_group_id')) { $customer_group_id = '0'; } else { $customer_group_id = $sppc_customer_group_id; } if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) { // BOF Separate Pricing per Customer, Hide products and categories from groups $new_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, p.products_price as products_price, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c using(products_id) left join " . TABLE_CATEGORIES . " c using(categories_id) where p.products_id = pd.products_id and products_status = '1' and find_in_set('" . $customer_group_id . "', products_hide_from_groups) = 0 and find_in_set('" . $customer_group_id . "', categories_hide_from_groups) = 0 and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS); } else { $new_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, p.products_price as products_price, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c using(products_id) left join " . TABLE_CATEGORIES . " c using(categories_id) where p.products_id = pd.products_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' and find_in_set('" . $customer_group_id . "', products_hide_from_groups) = 0 and find_in_set('" . $customer_group_id . "', categories_hide_from_groups) = 0 and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added desc limit ". MAX_DISPLAY_NEW_PRODUCTS); } But currently my code actually looks like if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) { // BOF Separate Pricing Per Customer $new_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, p.products_price, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and pd.language_id = '" . (int)$languages_id . "' and p.products_id = pd.products_id order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS); } else { $new_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, p.products_price, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c using(products_id) left join " . TABLE_CATEGORIES . " c using(categories_id) where c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' and pd.language_id = '" . (int)$languages_id . "' and p.products_id = pd.products_id order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS); } // global variable (session) $sppc_customer_group_id -> local variable customer_group_id if (isset($_SESSION['sppc_customer_group_id']) && $_SESSION['sppc_customer_group_id'] != '0') { $customer_group_id = $_SESSION['sppc_customer_group_id']; } else { $customer_group_id = '0'; } You can see the queries are different, and I'm not 100% on SQL syntax, perhaps someone could take my current code and merge into it the code from the "Hide Categories" instructions for me. There's also catalog/advanced_search_result.php Line 258-273 **REPLACE** if ($status_tmp_product_prices_table == true) { $from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c"; } elseif ($status_tmp_special_prices_table == true) { $from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id , " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c"; } else { $from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c"; } // EOF Separate Pricing Per Customer if ( (DISPLAY_PRICE_WITH_TAX == 'true') && (tep_not_null($pfrom) || tep_not_null($pto)) ) { if (!tep_session_is_registered('customer_country_id')) { $customer_country_id = STORE_COUNTRY; $customer_zone_id = STORE_ZONE; } $from_str .= " left join " . TABLE_TAX_RATES . " tr on p.products_tax_class_id = tr.tax_class_id left join " . TABLE_ZONES_TO_GEO_ZONES . " gz on tr.tax_zone_id = gz.geo_zone_id and (gz.zone_country_id is null or gz.zone_country_id = '0' or gz.zone_country_id = '" . (int)$customer_country_id . "') and (gz.zone_id is null or gz.zone_id = '0' or gz.zone_id = '" . (int)$customer_zone_id . "')"; } **WITH** // next parts are changed for MySQL 5 compatibility if ($status_tmp_product_prices_table == true) { $from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id) left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c"; } elseif ($status_tmp_special_prices_table == true) { $from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id) left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id"; } else { $from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id"; } // EOF Separate Pricing Per Customer if ( (DISPLAY_PRICE_WITH_TAX == 'true') && (tep_not_null($pfrom) || tep_not_null($pto)) ) { if (!tep_session_is_registered('customer_country_id')) { $customer_country_id = STORE_COUNTRY; $customer_zone_id = STORE_ZONE; } $from_str .= " left join " . TABLE_TAX_RATES . " tr on p.products_tax_class_id = tr.tax_class_id left join " . TABLE_ZONES_TO_GEO_ZONES . " gz on tr.tax_zone_id = gz.geo_zone_id and (gz.zone_country_id is null or gz.zone_country_id = '0' or gz.zone_country_id = '" . (int)$customer_country_id . "') and (gz.zone_id is null or gz.zone_id = '0' or gz.zone_id = '" . (int)$customer_zone_id . "')"; } $from_str .= ", " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c"; But mine is currently if ($status_tmp_product_prices_table == true) { $from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id) left join " . $product_prices_table . " as tmp_pp using(products_id)"; } elseif ($status_tmp_special_prices_table == true) { $from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id) left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id "; } else { $from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id) "; } // EOF Separate Pricing Per Customer if ( (DISPLAY_PRICE_WITH_TAX == 'true') && (tep_not_null($pfrom) || tep_not_null($pto)) ) { if (!tep_session_is_registered('customer_country_id')) { $customer_country_id = STORE_COUNTRY; $customer_zone_id = STORE_ZONE; } $from_str .= " left join " . TABLE_TAX_RATES . " tr on p.products_tax_class_id = tr.tax_class_id left join " . TABLE_ZONES_TO_GEO_ZONES . " gz on tr.tax_zone_id = gz.geo_zone_id and (gz.zone_country_id is null or gz.zone_country_id = '0' or gz.zone_country_id = '" . (int)$customer_country_id . "') and (gz.zone_id is null or gz.zone_id = '0' or gz.zone_id = '" . (int)$customer_zone_id . "')"; } I'm not sure what the third file was, I had a bash at it, and will upload to see if it's ok or not (probably not), it might have been categories.php
  15. AJStevens

    Seperate Pricing Per Customer v3.5

    Oh fudge, I finished installing SPPC 4.2.0 and am almost done installing "Hide products from customer groups for SPPC" although, I'm having a little trouble as this seems out of date compared to SPPC 4.2.0, there's about three files I'm having to work out the queries for (new_products.php, advanced_search_results.php and one other). Now there's a SPPC 4.2.1a! Can someone help me, I'm running out of time to get this live.
×