Hello I have a php script which I need to add to the product page,
any ideas? php include does not work and crashes my website....
I think I will need to add it to catalog/model/catalog/product.php and then call it in the product.tpl file...
but I have no idea how to do that...
any ideas? php include does not work and crashes my website....
I think I will need to add it to catalog/model/catalog/product.php and then call it in the product.tpl file...
but I have no idea how to do that...
Script runs fine if you view it in it's own page... When using php included it doesn't load the page and after 5 minutes of trying to load it gave a random SQL error first time and second time gave a 500 error, I am using the vqmod to display SKU on product page, could they be conflicting or something!
Try putting the php code directly in the template file - I do that all the time.
http://scarletandjones.com/
http://sharpdressedman.co.uk/
http://coffincompany.co.uk/
http://horsesculptures.co.uk/
If I've helped you out, why not buy me a beer? http://craigmurray.me.uk
I did try that but it only reognises the first few lines as php.
I have asked the people who designed the script to have a go at inserting it.
If they cant get it right (god help us all LOL) then I am going to remove vqmod and try php include again, I am fairly sure they were conflicting somehow...

I have asked the people who designed the script to have a go at inserting it.
If they cant get it right (god help us all LOL) then I am going to remove vqmod and try php include again, I am fairly sure they were conflicting somehow...

ok they tried to do it,
still get 500 error, i removed vqmod but still not working... this is very strange
still get 500 error, i removed vqmod but still not working... this is very strange

well if their script runs on it's own it may be an issue of conflicting headers or something along those lines. Is the script designed to be embedded into other pages or to run on it's own?
OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter
OK this is out my error log
2011-02-17 5:36:45 - PHP Warning: in_array() [<a href='function.in-array'>function.in-array</a>]: Wrong datatype for second argument in /home/content/40/7355040/html/shop/catalog/model/catalog/timer.php on line 90
and this is line 90 of the file in question...
if (in_array($dayDate, $holidays)) {
return false;
Well its a custom bit of script I have had made, they knew it was supposed to be embedded,
they edited it so I can use
<?php
include('timer.php');
echo(getCountDownTimerString());
?>
it works if i put that in a blank php file but gives 500 error when i add it to product.tpl
2011-02-17 5:36:45 - PHP Warning: in_array() [<a href='function.in-array'>function.in-array</a>]: Wrong datatype for second argument in /home/content/40/7355040/html/shop/catalog/model/catalog/timer.php on line 90
and this is line 90 of the file in question...
if (in_array($dayDate, $holidays)) {
return false;
Well its a custom bit of script I have had made, they knew it was supposed to be embedded,
they edited it so I can use
<?php
include('timer.php');
echo(getCountDownTimerString());
?>
it works if i put that in a blank php file but gives 500 error when i add it to product.tpl
well the most likely cause of that error is that the array is not set, which would mean backtracking through the program to figure out why not.deludeddonny wrote:OK this is out my error log
2011-02-17 5:36:45 - PHP Warning: in_array() [<a href='function.in-array'>function.in-array</a>]: Wrong datatype for second argument in /home/content/40/7355040/html/shop/catalog/model/catalog/timer.php on line 90
and this is line 90 of the file in question...
if (in_array($dayDate, $holidays)) {
return false;
Well its a custom bit of script I have had made, they knew it was supposed to be embedded,
they edited it so I can use
<?php
include('timer.php');
echo(getCountDownTimerString());
?>
it works if i put that in a blank php file but gives 500 error when i add it to product.tpl
OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter
OK odd but I think this is causing it...
Here is the array
Code: Select all
function isDayOK($ts) {
global $holidays;
global $daysWorking;
$dayDate = date(DATE_FORMAT, $ts);
$dayOfTheWeek = date('N', $ts);
if (in_array($dayDate, $holidays)) {
return false;
}
if (!$daysWorking[$dayOfTheWeek]) {
return false;
}
return true;
}
Code: Select all
$holidays = array(
'01/01/2011',
'25/12/2011'
);
$daysWorking = array(
'1' => true,
'2' => true,
'3' => true,
'4' => true,
'5' => true,
'6' => false,
'7' => false,
);
Who is online
Users browsing this forum: No registered users and 20 guests