As you can see there are some blank space between the products. I think those are products that have been disable. How to code it to remove just like typing the name?
I don't think these are disabled products. I think these are product which have something wrong with their name, like empty name or name embeded into html tags or something.
Basically first character in query string should be ?, and all other separators must be &, e.g. example.com/?a=b&c=d&e=f.
http://www.bolomie.com/&tracking=stenno should be
http://www.bolomie.com/?tracking=stenno
Actually I have create a test account with the name 'abc aaa'. I have bought an item from the tracking link with a guest checkout. In the admin, I can see from the order that there is a $5.00 commission. but I cannot add it to proceed to the next step. What I want to see is that the function of transfer earnings to customer account as store credits. If you know what I mean.
You can use any other affiliate account with positive balance. Password is demo for all accounts with @example.com in emails.
One more thing, do you know how to code the tracking code to use the affiliate's first name instead of randomly?
This is rather complicated stuff for the forum, but anyway, you can try:
admin/model/sale/affiliate.php
catalog/model/affiliate/affiliate.php
in both files find the line with
public function addAffiliate in it
You'll see the next line after that is quite long line starting with
$this->db->query
So after that line with
$this->db->query you should insert the following code (in both files)
Code: Select all
$_res = $this->db->query("SELECT * FROM " . DB_PREFIX . "affiliate WHERE email = '" . $this->db->escape($data['email']) . "'");
$affiliate = $_res->row;
if($affiliate['firstname']) {
$new_code = html_entity_decode($affiliate['firstname'], ENT_QUOTES, 'UTF-8');
$old_locale = setlocale(LC_CTYPE, '0');
if(strtolower($old_locale) == 'c' || strtolower($old_locale) == 'posix') {
setlocale(LC_CTYPE, 'en_US');
} else {
$old_locale = false;
}
$new_code = iconv('UTF-8', 'ASCII//TRANSLIT', $new_code);
if($old_locale !== false) setlocale(LC_CTYPE, $old_locale);
$new_code = preg_replace("/[^a-z0-9]+/", '', strtolower($new_code));
$__i = 0;
$new_code_src = $new_code;
while(true) {
$_res = $this->db->query("SELECT affiliate_id from " . DB_PREFIX . "affiliate WHERE `code`='" . $this->db->escape($new_code) . "'");
if($_res->num_rows < 1) break;
$__i++;
$new_code = $new_code_src . $__i;
}
$affiliate['code'] = $new_code;
$this->db->query("UPDATE " . DB_PREFIX . "affiliate SET `code`='" . $this->db->escape($new_code) . "' WHERE affiliate_id='" . (int)$affiliate['affiliate_id'] . "'");
}