RE: Can a product link to an external site (ie: cafepress.com)?
MaxiDVD <[email protected]> 10 Sep 2003 11:38:32 -0000
| Newsgroups | gmane.comp.web.oscommerce.contributions |
|---|---|
| Message-ID | <a1092bff4c3824496b293c42cadbae18@osCommerce-Forums> |
This message was sent from: Contributions
http://forums.oscommerce.com/viewtopic.php?p=227321#227321
----------------------------------------------------------------
[b]sinbad and dehdmtw[/b]
This script allows for customizing the size of the Window, the Position - left right top ect, if you dont want scroll bars simply change:
[b]scrollbars=yes to scrollbars=no[/b]
[code]<?php
if (isset($cPath) && tep_not_null($cPath)) {
if ( $cPath == '1_6' ) { // Change 1_6 To Your Categories cPath Number
?>
<SCRIPT LANGUAGE="JavaScript">
window.open("http://www.maxidvd.com.au","height=200,width=200,left=80,top=80,scrollbars=yes"); // New Window to New Site
onClick=window.location=('<?php echo tep_href_link(FILENAME_DEFAULT);?>') // Redirect background to Homepage (With SID Intact)
</SCRIPT>
<?php
}
}
?>[/code]
[b]sinbad[/b]
I think you code placement is responsible for the error, javascript/php clash, try using the code above - just remeber to place it after a [b]?>[/b] php closing tag, somewhere towards the top of the page, but below the categories code-
[code] $category_depth = 'top';
if (isset($cPath) && tep_not_null($cPath)) {
$categories_products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");
$cateqories_products = tep_db_fetch_array($categories_products_query);
if ($cateqories_products['total'] > 0) {
$category_depth = 'products'; // display products
} else {
$category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$current_category_id . "'");
$category_parent = tep_db_fetch_array($category_parent_query);
if ($category_parent['total'] > 0) {
$category_depth = 'nested'; // navigate through the categories
} else {
$category_depth = 'products'; // category has no products, but display the 'no products' message
}
}
}
?>[/code]
[code]<?php
if (isset($cPath) && tep_not_null($cPath)) {
if ( $cPath == '1_6' ) { // Change 1_6 To Your Categories cPath Number
?>
<SCRIPT LANGUAGE="JavaScript">
window.open("http://www.maxidvd.com.au","height=200,width=200,left=80,top=80,scrollbars=yes"); // New Window to New Site
onClick=window.location=('<?php echo tep_href_link(FILENAME_DEFAULT);?>') // Redirect background to Homepage (With SID Intact)
</SCRIPT>
<?php
}
}
?>[/code]
Should work fine..
Cheers MaxiDVD