Hello peepz, been a while so trying to get back into the game and right now i have 2 webshop customers.. as always i am going for OpenCart (of course ) "from Denmark btw.."
okay so long of short. My boss at my local pizza already has a webshop, the oldest version of OpenCart (1.x).. the stable version, but the guy that did it ditched him and now the website literally looks.. well, not good.
I spoke it over with boss and he said if i could show him some good new design he would let me re-do the whole website, so guess where i am right now..
Anyhow, since it is a pizza-delivery shop he asked if it would be possible to "close orders" between 9 at night to 10-12 next morning (so basically only be able to order from website within 9 hours a day..)
is this possible? I said i would look into this but not sure since it's been a while since i have updated myself to the latest version of you guys..
Anyways i hope you guys can help a little.
Also on another note, i have been looking for a script online for a printer so that when my boss gets new orders the printer in the shop would make a "beep" sound and then automaticly print the orders. We found a temporary software for this but not sure this is a good one since we have to pay for it :/
Thanks again, hope you guys can help out also sorry for bad english, need to get back into the game again before i learn how to spell i guess hehe
All good, thanks again!
PS: If i posted this in wrong section, feel free to tell me or move it to the right section.. not sure if this part was support or discussion
Thanks again
okay so long of short. My boss at my local pizza already has a webshop, the oldest version of OpenCart (1.x).. the stable version, but the guy that did it ditched him and now the website literally looks.. well, not good.
I spoke it over with boss and he said if i could show him some good new design he would let me re-do the whole website, so guess where i am right now..
Anyhow, since it is a pizza-delivery shop he asked if it would be possible to "close orders" between 9 at night to 10-12 next morning (so basically only be able to order from website within 9 hours a day..)
is this possible? I said i would look into this but not sure since it's been a while since i have updated myself to the latest version of you guys..
Anyways i hope you guys can help a little.
Also on another note, i have been looking for a script online for a printer so that when my boss gets new orders the printer in the shop would make a "beep" sound and then automaticly print the orders. We found a temporary software for this but not sure this is a good one since we have to pay for it :/
Thanks again, hope you guys can help out also sorry for bad english, need to get back into the game again before i learn how to spell i guess hehe
All good, thanks again!
PS: If i posted this in wrong section, feel free to tell me or move it to the right section.. not sure if this part was support or discussion
Thanks again
Would be pretty easy, a few lines of PHP. Just check the time with PHP and replace the Add to Cart button with a message saying orders can only be placed between certain hours. Probably use some JavaScript also for the case where a user hasn't refreshed the page for a long time.
Forget that paid software, you just need a printer that can print what it receives by email - many new models have this. Then configure OpenCart to copy in the printer on order emails and job done.rootKID wrote: ↑Mon Jul 17, 2017 3:35 pmAlso on another note, i have been looking for a script online for a printer so that when my boss gets new orders the printer in the shop would make a "beep" sound and then automaticly print the orders. We found a temporary software for this but not sure this is a good one since we have to pay for it :/
Your English is very good actually and so was your description of the issues
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
Hello, thanks for the support and sorry for the delayed answer
The PHP part i get... but where should i put this part? Just in the .tmp/template code area? Just add in there like normal PHP code and then run it?
Also i have a new error, not sure why..
http://thai-chinese.dk/
Fatal error: Uncaught exception 'Twig_Error_Loader' with message 'Unable to find template "common/language.twig" (looked into: /home/thaionli/public_html/catalog/view/theme).' in /home/thaionli/public_html/system/library/template/Twig/Loader/Filesystem.php:215 Stack trace: #0 /home/thaionli/public_html/system/library/template/Twig/Loader/Filesystem.php(139): Twig_Loader_Filesystem->findTemplate('common/language...') #1 /home/thaionli/public_html/system/library/template/Twig/Environment.php(312): Twig_Loader_Filesystem->getCacheKey('common/language...') #2 /home/thaionli/public_html/system/library/template/Twig/Environment.php(378): Twig_Environment->getTemplateClass('common/language...', NULL) #3 /home/thaionli/opencart_storage/modification/system/library/template/twig.php(45): Twig_Environment->loadTemplate('common/language...') #4 /home/thaionli/public_html/system/library/template.php(20): Template\Twig->render('common/language', '1') #5 /home/thaionli/opencart_storage/modification/system/engine/loader.php(85): Template in /home/thaionli/public_html/system/library/template/Twig/Loader/Filesystem.php on line 215
any ideas? :/
Thanks for the great help again!
EDITED DATE: 22-07-2017
So i just found out today that the error i just posted, wen't away the second i tried to turn off the "Maintenance mode" in the Admin Settings area... trouble with the template system maybe?
Anyhow still working on it.. if you find a solution before me, thanks!
Also note that this error occurs on another website... not my bosses website, my bosses website is another URL, here:
http://www.allespizza-kiosk.dk/
The PHP part i get... but where should i put this part? Just in the .tmp/template code area? Just add in there like normal PHP code and then run it?
Also i have a new error, not sure why..
http://thai-chinese.dk/
Fatal error: Uncaught exception 'Twig_Error_Loader' with message 'Unable to find template "common/language.twig" (looked into: /home/thaionli/public_html/catalog/view/theme).' in /home/thaionli/public_html/system/library/template/Twig/Loader/Filesystem.php:215 Stack trace: #0 /home/thaionli/public_html/system/library/template/Twig/Loader/Filesystem.php(139): Twig_Loader_Filesystem->findTemplate('common/language...') #1 /home/thaionli/public_html/system/library/template/Twig/Environment.php(312): Twig_Loader_Filesystem->getCacheKey('common/language...') #2 /home/thaionli/public_html/system/library/template/Twig/Environment.php(378): Twig_Environment->getTemplateClass('common/language...', NULL) #3 /home/thaionli/opencart_storage/modification/system/library/template/twig.php(45): Twig_Environment->loadTemplate('common/language...') #4 /home/thaionli/public_html/system/library/template.php(20): Template\Twig->render('common/language', '1') #5 /home/thaionli/opencart_storage/modification/system/engine/loader.php(85): Template in /home/thaionli/public_html/system/library/template/Twig/Loader/Filesystem.php on line 215
any ideas? :/
Thanks for the great help again!
EDITED DATE: 22-07-2017
So i just found out today that the error i just posted, wen't away the second i tried to turn off the "Maintenance mode" in the Admin Settings area... trouble with the template system maybe?
Anyhow still working on it.. if you find a solution before me, thanks!
Also note that this error occurs on another website... not my bosses website, my bosses website is another URL, here:
http://www.allespizza-kiosk.dk/
Would be pretty easy, a few lines of PHP. Just check the time with PHP and replace the Add to Cart button with a message saying orders can only be placed between certain hours. Probably use some JavaScript also for the case where a user hasn't refreshed the page for a long time.
We use it in https://www.grandform.es/
We use it in https://www.grandform.es/
rootKID wrote: ↑Sat Jul 22, 2017 4:55 amHello, thanks for the support and sorry for the delayed answer
The PHP part i get... but where should i put this part? Just in the .tmp/template code area? Just add in there like normal PHP code and then run it?
Also i have a new error, not sure why..
http://thai-chinese.dk/
Fatal error: Uncaught exception 'Twig_Error_Loader' with message 'Unable to find template "common/language.twig" (looked into: /home/thaionli/public_html/catalog/view/theme).' in /home/thaionli/public_html/system/library/template/Twig/Loader/Filesystem.php:215 Stack trace: #0 /home/thaionli/public_html/system/library/template/Twig/Loader/Filesystem.php(139): Twig_Loader_Filesystem->findTemplate('common/language...') #1 /home/thaionli/public_html/system/library/template/Twig/Environment.php(312): Twig_Loader_Filesystem->getCacheKey('common/language...') #2 /home/thaionli/public_html/system/library/template/Twig/Environment.php(378): Twig_Environment->getTemplateClass('common/language...', NULL) #3 /home/thaionli/opencart_storage/modification/system/library/template/twig.php(45): Twig_Environment->loadTemplate('common/language...') #4 /home/thaionli/public_html/system/library/template.php(20): Template\Twig->render('common/language', '1') #5 /home/thaionli/opencart_storage/modification/system/engine/loader.php(85): Template in /home/thaionli/public_html/system/library/template/Twig/Loader/Filesystem.php on line 215
any ideas? :/
Thanks for the great help again!
EDITED DATE: 22-07-2017
So i just found out today that the error i just posted, wen't away the second i tried to turn off the "Maintenance mode" in the Admin Settings area... trouble with the template system maybe?
Anyhow still working on it.. if you find a solution before me, thanks!
Also note that this error occurs on another website... not my bosses website, my bosses website is another URL, here:
http://www.allespizza-kiosk.dk/
This can be of help, since it likely surpasses free 'forum-assistance'.
Ernie
https://www.opencart.com/index.php?rout ... p+at+hours
Ernie
https://www.opencart.com/index.php?rout ... p+at+hours
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
Setting an automated closing time session template may affect your site reputation with Search Engines. Rather disable the add-to-cart buttons during closing times than disabling the views from the categories and products page themselves.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Good idea but how to do this? I am not the best in doing JS :/straightlight wrote: ↑Mon Oct 15, 2018 7:38 amSetting an automated closing time session template may affect your site reputation with Search Engines. Rather disable the add-to-cart buttons during closing times than disabling the views from the categories and products page themselves.
I'm not sure why this is even necessary. Just add a notice with the message in the header, which will pop in a given period of time and say "Hey, I'm fkn sleepy, go away!" or something like that. A basic understanding of MVC and OCMod is required.
Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com
Untested but, idealistically, to start the idea. Ensure to create a backup of the existing files below before proceeding. This has been coded for OC v3.0.3.2 release.rootKID wrote: ↑Fri May 24, 2019 5:47 amGood idea but how to do this? I am not the best in doing JS :/straightlight wrote: ↑Mon Oct 15, 2018 7:38 amSetting an automated closing time session template may affect your site reputation with Search Engines. Rather disable the add-to-cart buttons during closing times than disabling the views from the categories and products page themselves.
In your catalog/controller/product folder, create the file: product_maintenance.php .
Then, add the following:
Code: Select all
<?php
class ControllerProductProductMaintenance extends Controller {
public function index() {
}
public function validateMaintenance() {
$json = array();
if (isset($this->request->post['product_id'])) {
$this->load->language('product/product_maintenance');
if (!$this->storeIsOpen()) {
$json['error']['maintenance'] = $this->language->get('error_maintenance');
}
}
$this->response->addHeader('Content-Type: application/json');
$this->response->setOutput(json_encode($json));
}
// Source: https://stackoverflow.com/questions/14904864/determine-if-business-is-open-closed-based-on-business-hours
protected function storeIsOpen() {
$status = false;
$storeSchedule = array('Mon' => ['08:00 AM' => '05:00 PM'],
'Tue' => ['08:00 AM' => '05:00 PM'],
'Wed' => ['08:00 AM' => '05:00 PM'],
'Thu' => ['08:00 AM' => '05:00 PM'],
'Fri' => ['08:00 AM' => '05:00 PM']
);
// Get current East Coast US time
$timeObject = new DateTime('America/New_York');
$timestamp = $timeObject->getTimeStamp();
$currentTime = $timeObject->setTimestamp($timestamp)->format('H:i A');
// Loop through time ranges for current day
foreach ($storeSchedule[date('D', $timestamp)] as $startTime => $endTime) {
// Create time objects from start/end times and format as string (24hr AM/PM)
$startTime = DateTime::createFromFormat('h:i A', $startTime)->format('H:i A');
$endTime = DateTime::createFromFormat('h:i A', $endTime)->format('H:i A');
// Check if current time is within the range
if (($startTime < $currentTime) && ($currentTime < $endTime)) {
$status = true;
break;
}
}
return $status;
}
}
Followed is based on the default theme. You'll have to make the adjustment in your custom theme.
In catalog/view/theme/<your_theme>/template/product/product.twig file,
find:
Code: Select all
<script type="text/javascript"><!--
$('#button-cart').on('click', function() {
$.ajax({
url: 'index.php?route=checkout/cart/add',
type: 'post',
data: $('#product input[type=\'text\'], #product input[type=\'hidden\'], #product input[type=\'radio\']:checked, #product input[type=\'checkbox\']:checked, #product select, #product textarea'),
dataType: 'json',
beforeSend: function() {
$('#button-cart').button('loading');
},
complete: function() {
$('#button-cart').button('reset');
},
success: function(json) {
$('.alert-dismissible, .text-danger').remove();
$('.form-group').removeClass('has-error');
if (json['error']) {
if (json['error']['option']) {
for (i in json['error']['option']) {
var element = $('#input-option' + i.replace('_', '-'));
if (element.parent().hasClass('input-group')) {
element.parent().after('<div class="text-danger">' + json['error']['option'][i] + '</div>');
} else {
element.after('<div class="text-danger">' + json['error']['option'][i] + '</div>');
}
}
}
if (json['error']['recurring']) {
$('select[name=\'recurring_id\']').after('<div class="text-danger">' + json['error']['recurring'] + '</div>');
}
// Highlight any found errors
$('.text-danger').parent().addClass('has-error');
}
if (json['success']) {
$('.breadcrumb').after('<div class="alert alert-success alert-dismissible">' + json['success'] + '<button type="button" class="close" data-dismiss="alert">×</button></div>');
$('#cart > button').html('<span id="cart-total"><i class="fa fa-shopping-cart"></i> ' + json['total'] + '</span>');
$('html, body').animate({ scrollTop: 0 }, 'slow');
$('#cart > ul').load('index.php?route=common/cart/info ul li');
}
},
error: function(xhr, ajaxOptions, thrownError) {
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
});
});
//--></script>
Then, find:
Code: Select all
$(document).ready(function() {
Code: Select all
$.ajax({
url: 'index.php?route=product/product_maintenance/validateMaintenance',
type: 'post',
dataType: 'json',
data: 'product_id=' + {{ product_id }}',
beforeSend: function() {
$('#button-cart').button('loading');
},
complete: function() {
$('#button-cart').button('reset');
},
success: function(json) {
$('.alert-dismissible').remove();
if (json['error']['maintenance']) {
$('#button-cart').prop('disabled', true);
$('.breadcrumb').after('<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> ' + json['error']['maintenance'] + '</div>');
} else {
$('#button-cart').on('click', function() {
$.ajax({
url: 'index.php?route=checkout/cart/add',
type: 'post',
data: $('#product input[type=\'text\'], #product input[type=\'hidden\'], #product input[type=\'radio\']:checked, #product input[type=\'checkbox\']:checked, #product select, #product textarea'),
dataType: 'json',
beforeSend: function() {
$('#button-cart').button('loading');
},
complete: function() {
$('#button-cart').button('reset');
},
success: function(json) {
$('.alert-dismissible, .text-danger').remove();
$('.form-group').removeClass('has-error');
if (json['error']) {
if (json['error']['option']) {
for (i in json['error']['option']) {
var element = $('#input-option' + i.replace('_', '-'));
if (element.parent().hasClass('input-group')) {
element.parent().after('<div class="text-danger">' + json['error']['option'][i] + '</div>');
} else {
element.after('<div class="text-danger">' + json['error']['option'][i] + '</div>');
}
}
}
if (json['error']['recurring']) {
$('select[name=\'recurring_id\']').after('<div class="text-danger">' + json['error']['recurring'] + '</div>');
}
// Highlight any found errors
$('.text-danger').parent().addClass('has-error');
}
if (json['success']) {
$('.breadcrumb').after('<div class="alert alert-success alert-dismissible">' + json['success'] + '<button type="button" class="close" data-dismiss="alert">×</button></div>');
$('#cart > button').html('<span id="cart-total"><i class="fa fa-shopping-cart"></i> ' + json['total'] + '</span>');
$('html, body').animate({ scrollTop: 0 }, 'slow');
$('#cart > ul').load('index.php?route=common/cart/info ul li');
}
},
error: function(xhr, ajaxOptions, thrownError) {
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
});
});
}
}
});
Add:
Code: Select all
<?php
$_['error_maintenance'] = 'Our store is currently closed for the day!';
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Who is online
Users browsing this forum: No registered users and 264 guests