Norman in 't Veldt
Moderator OpenCart Forums
_________________ READ and Search BEFORE POSTING _________________
Our FREE search: Find your answer FAST!.
[How to] BTW + Verzend + betaal setup.
3 days ago I installed 1.4.0 without any problem, working great.
Yesterday installed 1.4.1 and today 1.4.2 (man, thats even too much releases.. I wasn't prepared to all this as i come from osc ).
Anyway, I noticed the same bug in 1.4.1 and 1.4.2, I got wrong urls like this:
http://www.domain.name\/...etc
so no images, stylesheet and products are showing in the Front End , the Back End works fine.
By the way I am on win vista 32 and apache.
I've seen somebody posted in 1.4.1 bugs that maybe a problem with the rtrim function in index.php , anybody is getting the same problem?
Thanks
I got it working following the instructions of the user Blueforce:
in index.php on line 93 , 97 , 100
Code: Select all
define('HTTP_SERVER', 'http://' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/') . '/');
Code: Select all
define('HTTP_SERVER', 'http://' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/.\\') . '/');
Thanks to Blueforce,
Regards
1. it shows always the last entry
2. all possible templates are marked as ' selected="selected"
This because following is wrong:
Code: Select all
<?php foreach ($templates as $template) { ?>
<?php if ($template == $template) { ?>
<option value="<?php echo $template; ?>" selected="selected"><?php echo $template; ?></option>
<?php } else { ?>
<option value="<?php echo $template; ?>"><?php echo $template; ?></option>
<?php } ?>
<?php } ?>
Code: Select all
<?php foreach ($templates as $tmpl) { ?>
<?php if ($tmpl == $template) { ?>
<option value="<?php echo $tmpl; ?>" selected="selected"><?php echo $tmpl; ?></option>
<?php } else { ?>
<option value="<?php echo $tmpl; ?>"><?php echo $tmpl; ?></option>
<?php } ?>
<?php } ?>
Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.
/index.php
//Store
Code: Select all
$query = $db->query("SELECT * FROM " . DB_PREFIX . "store WHERE url = '" . $db->escape(HTTP_SERVER) . "'");
Code: Select all
$query = $db->query("SELECT * FROM " . DB_PREFIX . "store WHERE url = '" . str_replace('www.', '', ($db->escape(HTTP_SERVER))) . "'");
public function addStore
Code: Select all
$this->db->query("INSERT INTO " . DB_PREFIX . "store SET name = '" . $this->db->escape($data['name']) . "', url = '" . $this->db->escape($data['url']) . "', title = '" . $this->db->escape($data['title']) . "', meta_description = '" . $this->db->escape($data['meta_description']) . "', template = '" . $this->db->escape($data['template']) . "', country_id = '" . (int)$data['country_id'] . "', zone_id = '" . (int)$data['zone_id'] . "', language = '" . $this->db->escape($data['language']) . "', currency = '" . $this->db->escape($data['currency']) . "', tax = '" . (int)$data['tax'] . "', customer_group_id = '" . (int)$data['customer_group_id'] . "', customer_price = '" . (int)$data['customer_price'] . "', customer_approval = '" . (int)$data['customer_approval'] . "', guest_checkout = '" . (int)$data['guest_checkout'] . "', account_id = '" . (int)$data['account_id'] . "', checkout_id = '" . (int)$data['checkout_id'] . "', stock_display = '" . (int)$data['stock_display'] . "', stock_check = '" . (int)$data['stock_check'] . "', stock_checkout = '" . (int)$data['stock_checkout'] . "', stock_subtract = '" . (int)$data['stock_subtract'] . "', order_status_id = '" . (int)$data['order_status_id'] . "', stock_status_id = '" . (int)$data['stock_status_id'] . "', logo = '" . $this->db->escape($data['logo']) . "', icon = '" . $this->db->escape($data['icon']) . "', image_thumb_width = '" . (int)$data['image_thumb_width'] . "', image_thumb_height = '" . (int)$data['image_thumb_height'] . "', image_popup_width = '" . (int)$data['image_popup_width'] . "', image_popup_height = '" . (int)$data['image_popup_height'] . "', image_category_width = '" . (int)$data['image_category_width'] . "', image_category_height = '" . (int)$data['image_category_height'] . "', image_product_width = '" . (int)$data['image_product_width'] . "', image_product_height = '" . (int)$data['image_product_height'] . "', image_additional_width = '" . (int)$data['image_additional_width'] . "', image_additional_height = '" . (int)$data['image_additional_height'] . "', image_related_width = '" . (int)$data['image_related_width'] . "', image_related_height = '" . (int)$data['image_related_height'] . "', image_cart_width = '" . (int)$data['image_cart_width'] . "', image_cart_height = '" . (int)$data['image_cart_height'] . "'");
Code: Select all
$this->db->query("INSERT INTO " . DB_PREFIX . "store SET name = '" . $this->db->escape($data['name']) . "', url = '" . str_replace('www.', '', ($this->db->escape($data['url']))) . "', title = '" . $this->db->escape($data['title']) . "', meta_description = '" . $this->db->escape($data['meta_description']) . "', template = '" . $this->db->escape($data['template']) . "', country_id = '" . (int)$data['country_id'] . "', zone_id = '" . (int)$data['zone_id'] . "', language = '" . $this->db->escape($data['language']) . "', currency = '" . $this->db->escape($data['currency']) . "', tax = '" . (int)$data['tax'] . "', customer_group_id = '" . (int)$data['customer_group_id'] . "', customer_price = '" . (int)$data['customer_price'] . "', customer_approval = '" . (int)$data['customer_approval'] . "', guest_checkout = '" . (int)$data['guest_checkout'] . "', account_id = '" . (int)$data['account_id'] . "', checkout_id = '" . (int)$data['checkout_id'] . "', stock_display = '" . (int)$data['stock_display'] . "', stock_check = '" . (int)$data['stock_check'] . "', stock_checkout = '" . (int)$data['stock_checkout'] . "', stock_subtract = '" . (int)$data['stock_subtract'] . "', order_status_id = '" . (int)$data['order_status_id'] . "', stock_status_id = '" . (int)$data['stock_status_id'] . "', logo = '" . $this->db->escape($data['logo']) . "', icon = '" . $this->db->escape($data['icon']) . "', image_thumb_width = '" . (int)$data['image_thumb_width'] . "', image_thumb_height = '" . (int)$data['image_thumb_height'] . "', image_popup_width = '" . (int)$data['image_popup_width'] . "', image_popup_height = '" . (int)$data['image_popup_height'] . "', image_category_width = '" . (int)$data['image_category_width'] . "', image_category_height = '" . (int)$data['image_category_height'] . "', image_product_width = '" . (int)$data['image_product_width'] . "', image_product_height = '" . (int)$data['image_product_height'] . "', image_additional_width = '" . (int)$data['image_additional_width'] . "', image_additional_height = '" . (int)$data['image_additional_height'] . "', image_related_width = '" . (int)$data['image_related_width'] . "', image_related_height = '" . (int)$data['image_related_height'] . "', image_cart_width = '" . (int)$data['image_cart_width'] . "', image_cart_height = '" . (int)$data['image_cart_height'] . "'");
Code: Select all
$this->db->query("UPDATE " . DB_PREFIX . "store SET name = '" . $this->db->escape($data['name']) . "', url = '" . $this->db->escape($data['url']) . "', title = '" . $this->db->escape($data['title']) . "', meta_description = '" . $this->db->escape($data['meta_description']) . "', template = '" . $this->db->escape($data['template']) . "', country_id = '" . (int)$data['country_id'] . "', zone_id = '" . (int)$data['zone_id'] . "', language = '" . $this->db->escape($data['language']) . "', currency = '" . $this->db->escape($data['currency']) . "', tax = '" . (int)$data['tax'] . "', customer_group_id = '" . (int)$data['customer_group_id'] . "', customer_price = '" . (int)$data['customer_price'] . "', customer_approval = '" . (int)$data['customer_approval'] . "', guest_checkout = '" . (int)$data['guest_checkout'] . "', account_id = '" . (int)$data['account_id'] . "', checkout_id = '" . (int)$data['checkout_id'] . "', stock_display = '" . (int)$data['stock_display'] . "', stock_check = '" . (int)$data['stock_check'] . "', stock_checkout = '" . (int)$data['stock_checkout'] . "', stock_subtract = '" . (int)$data['stock_subtract'] . "', order_status_id = '" . (int)$data['order_status_id'] . "', stock_status_id = '" . (int)$data['stock_status_id'] . "', logo = '" . $this->db->escape($data['logo']) . "', icon = '" . $this->db->escape($data['icon']) . "', image_thumb_width = '" . (int)$data['image_thumb_width'] . "', image_thumb_height = '" . (int)$data['image_thumb_height'] . "', image_popup_width = '" . (int)$data['image_popup_width'] . "', image_popup_height = '" . (int)$data['image_popup_height'] . "', image_category_width = '" . (int)$data['image_category_width'] . "', image_category_height = '" . (int)$data['image_category_height'] . "', image_product_width = '" . (int)$data['image_product_width'] . "', image_product_height = '" . (int)$data['image_product_height'] . "', image_additional_width = '" . (int)$data['image_additional_width'] . "', image_additional_height = '" . (int)$data['image_additional_height'] . "', image_related_width = '" . (int)$data['image_related_width'] . "', image_related_height = '" . (int)$data['image_related_height'] . "', image_cart_width = '" . (int)$data['image_cart_width'] . "', image_cart_height = '" . (int)$data['image_cart_height'] . "' WHERE store_id = '" . (int)$store_id . "'");
Code: Select all
$this->db->query("UPDATE " . DB_PREFIX . "store SET name = '" . $this->db->escape($data['name']) . "', url = '" . str_replace('www.', '', ($this->db->escape($data['url']))) . "', title = '" . $this->db->escape($data['title']) . "', meta_description = '" . $this->db->escape($data['meta_description']) . "', template = '" . $this->db->escape($data['template']) . "', country_id = '" . (int)$data['country_id'] . "', zone_id = '" . (int)$data['zone_id'] . "', language = '" . $this->db->escape($data['language']) . "', currency = '" . $this->db->escape($data['currency']) . "', tax = '" . (int)$data['tax'] . "', customer_group_id = '" . (int)$data['customer_group_id'] . "', customer_price = '" . (int)$data['customer_price'] . "', customer_approval = '" . (int)$data['customer_approval'] . "', guest_checkout = '" . (int)$data['guest_checkout'] . "', account_id = '" . (int)$data['account_id'] . "', checkout_id = '" . (int)$data['checkout_id'] . "', stock_display = '" . (int)$data['stock_display'] . "', stock_check = '" . (int)$data['stock_check'] . "', stock_checkout = '" . (int)$data['stock_checkout'] . "', stock_subtract = '" . (int)$data['stock_subtract'] . "', order_status_id = '" . (int)$data['order_status_id'] . "', stock_status_id = '" . (int)$data['stock_status_id'] . "', logo = '" . $this->db->escape($data['logo']) . "', icon = '" . $this->db->escape($data['icon']) . "', image_thumb_width = '" . (int)$data['image_thumb_width'] . "', image_thumb_height = '" . (int)$data['image_thumb_height'] . "', image_popup_width = '" . (int)$data['image_popup_width'] . "', image_popup_height = '" . (int)$data['image_popup_height'] . "', image_category_width = '" . (int)$data['image_category_width'] . "', image_category_height = '" . (int)$data['image_category_height'] . "', image_product_width = '" . (int)$data['image_product_width'] . "', image_product_height = '" . (int)$data['image_product_height'] . "', image_additional_width = '" . (int)$data['image_additional_width'] . "', image_additional_height = '" . (int)$data['image_additional_height'] . "', image_related_width = '" . (int)$data['image_related_width'] . "', image_related_height = '" . (int)$data['image_related_height'] . "', image_cart_width = '" . (int)$data['image_cart_width'] . "', image_cart_height = '" . (int)$data['image_cart_height'] . "' WHERE store_id = '" . (int)$store_id . "'");
Code: Select all
$_['entry_url'] = 'Store URL:<br /><span class="help">Include the full URL to your store. Make sure to add \'/\' at the end. Example: http://wwww.yourdomain.com/path/</span>';
Code: Select all
$_['entry_url'] = 'Store URL:<br /><span class="help">Include the URL to your store. Do NOT include \'www.\' and make sure to add \'/\' at the end. Example: http://yourdomain.com/path/</span>';
-Ryan
I had problems getting the order-confirmation out in 1.4.1.
Norman in 't Veldt
Moderator OpenCart Forums
_________________ READ and Search BEFORE POSTING _________________
Our FREE search: Find your answer FAST!.
[How to] BTW + Verzend + betaal setup.
Showing %s to %s of %s (%s Pages) in the product page..
by the way many thanks Daniel for your hard work.
Reason: Splitted form OpenCart 1.4.2
I am new to Opencart, PHP, and many things, but willing to learn. I am setting up a store of my own to sell some coffee.
After changing in index.php on line 93 , 97 , 100, as described by dev3fx, I got this error at the top of my page:
trying to change some HTTPs to HTTP doesn't fix. I might doing something wrong. I also can't get to login tab and other, but still can view the products. Yet, the pictures are missing.Constant HTTP_SERVER already defined in /var/www/vhosts/bkksprolab.com/subdomains/shop/httpdocs/opencart/index.php on line 100Notice: Use of undefined constant HTTPS_SERVER - assumed 'HTTPS_SERVER' in /var/www/vhosts/bkksprolab.com/subdomains/shop/httpdocs/opencart/index.php on line 101Notice: Use of undefined constant HTTPS_SERVER - assumed 'HTTPS_SERVER' in /var/www/vhosts/bkksprolab.com/subdomains/shop/httpdocs/opencart/catalog/controller/common/header.php on line 82Notice: Use of undefined constant HTTPS_SERVER - assumed 'HTTPS_SERVER' in /var/www/vhosts/bkksprolab.com/subdomains/shop/httpdocs/opencart/catalog/controller/common/header.php on line 84Notice: Use of undefined constant HTTPS_SERVER - assumed 'HTTPS_SERVER' in /var/www/vhosts/bkksprolab.com/subdomains/shop/httpdocs/opencart/catalog/controller/common/header.php on line 87
Please help.
work in progress, slowly, patiently
dev3fx wrote:
Yes, I did post a "fix" for this but NOT in the way dev3fx describes in his post!!!I got it working following the instructions of the user Blueforce:
in index.php on line 93 , 97 , 100
Code: Select all
define('HTTP_SERVER', 'http://' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/') . '/');
replace with:
Code: Select all
define('HTTP_SERVER', 'http://' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/.\\') . '/');
The ONLY thing you need to change in lines 93, 97, 100 are the part I marked in red colour:
rtrim(dirname($_SERVER['PHP_SELF']), '/')
to
rtrim(dirname($_SERVER['PHP_SELF']), '/.\\')
You should NOT paste the same line in all three places as described by dev3fx.
Just replace the part I marked red and you should be fine.
Best regards,
Leffe
Do not know where the bug is?emax4ever wrote:how to fix this bug?
Showing %s to %s of %s (%s Pages) in the product page..
by the way many thanks Daniel for your hard work.
The line changd to:
Code: Select all
'Showing {start} to {end} of {total} ({pages} Pages)';
Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.
Thank you Leffe,Blueforce wrote:Hi coffeecircus,
dev3fx wrote:Yes, I did post a "fix" for this but NOT in the way dev3fx describes in his post!!!I got it working following the instructions of the user Blueforce:
in index.php on line 93 , 97 , 100
Code: Select all
define('HTTP_SERVER', 'http://' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/') . '/');
replace with:
Code: Select all
define('HTTP_SERVER', 'http://' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/.\\') . '/');
The ONLY thing you need to change in lines 93, 97, 100 are the part I marked in red colour:
rtrim(dirname($_SERVER['PHP_SELF']), '/')
to
rtrim(dirname($_SERVER['PHP_SELF']), '/.\\')
You should NOT paste the same line in all three places as described by dev3fx.
Just replace the part I marked red and you should be fine.
Best regards,
Leffe
I fix this and all is well now. I will dig into the power of OpenCart more.
Very best,
work in progress, slowly, patiently
I have seen many posts on this in the Forum already but it seems I just can't get it to work. I am having an issue where I create a new Coupon, then I fill out all of the required data here are my settings
* Coupon Name: MATTS10
* Coupon Description: Coupon Description
* Code: BLAH BLAH
Type: Percentage
Discount: 30.0000
Total Amount: 30.0000
Customer Login: "No"
Free Shipping: "No"
Products: I've Selected just one product and tested and I've Selected all and tested (still same error).
Date Start: 2010-01-02
Date End: 2010-08-04
Uses Per Coupon: 1000
Uses Per Customer: 1000
Status: Enabled
The error I'm receiving is the following: "Error: Coupon is either invalid, expired or reached it's usage limit!"
Any help would be greatly appreciated.
THANK YOU!
P.S. The products I'm testing all have an inventory of 1000 or greater and all product options have an inventory of 1000 or greater...and setting "Subtract Inventory" is set to "NO"
public function getTotalProducts
Code: Select all
if (isset($data['filter_name']) && !is_null($data['filter_name'])) {
$sql .= " AND pd.name LIKE '%" . $this->db->escape($data['filter_name']) . "%'";
}
if (isset($data['filter_model']) && !is_null($data['filter_model'])) {
$sql .= " AND p.model LIKE '%" . $this->db->escape($data['filter_model']) . "%'";
}
Code: Select all
if (isset($data['filter_name']) && !is_null($data['filter_name'])) {
$sql .= " AND LCASE(pd.name) LIKE '%" . $this->db->escape(strtolower($data['filter_name'])) . "%'";
}
if (isset($data['filter_model']) && !is_null($data['filter_model'])) {
$sql .= " AND LCASE(p.model) LIKE '%" . $this->db->escape(strtolower($data['filter_model'])) . "%'";
}
-Ryan
Is this releated to OC 1.4.2?YellowSnow wrote:Hey All,
I have seen many posts on this in the Forum already but it seems I just can't get it to work. I am having an issue where I create a new Coupon, then I fill out all of the required data here are my settings
THANK YOU!
P.S. The products I'm testing all have an inventory of 1000 or greater and all product options have an inventory of 1000 or greater...and setting "Subtract Inventory" is set to "NO"
Norman in 't Veldt
Moderator OpenCart Forums
_________________ READ and Search BEFORE POSTING _________________
Our FREE search: Find your answer FAST!.
[How to] BTW + Verzend + betaal setup.
Code: Select all
$this->model_tool_seo_url->rewrite(HTTP_SERVER ......
Code: Select all
$this->model_tool_seo_url->rewrite(HTTPS_SERVER .....
which is indeed a 'great result'.unescaped & or unknown entity "&..."
If I go deeper, I will find something like (../catalog/controller/module/manufacturer.php):
Code: Select all
$this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/manufacturer&manufacturer_id=' . $result['manufacturer_id'])
Code: Select all
$this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $new_path)
Code: Select all
public function rewrite($link) {
if ($this->config->get('config_seo_url')) {
$url_data = parse_url(str_replace('&', '&', $link));
Unfortunately there are so less '&', that why the messages!
Playing around with URL building is once, knowing what to do another 'shoe'.
But great to say:
Now it is 'much' betterDaniel wrote:Basicly the url class was pretty stuiped. it should not have existed at all. whch frameworks have a url class like the one I used? I might as well just have used 2 functions.
IF the function rewrite is called every time when an URL is built (what it should - see below), then let the function do the work like (e.g):
instead of having (../catalog/model/tool/seo_url.php):
Code: Select all
} else {
return $link;
}
Code: Select all
} else {
$link = str_replace( '&', '&', $link );
return $link;
}
Code: Select all
} else {
$link = str_replace( '&', '&', $link ); // replace forgotten & with &
$link = str_replace( '&', '&', $link ); // and replace all & with &
return $link;
}
Too much redundant and unecessary code!
Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.
Needs to be corrected so that we can see the error message and be given a chance to correct it. ;-)
Users browsing this forum: No registered users and 84 guests