Hey James,
Here is a brief rundown of what would be required for a new field (like cost).
In the controller/tool/total_import.php file.
Line 434 ish: $this->data['field_map'] = array(
Add a 'cost' entry with the appropriate string (can use language file load or just a flat string like 'Cost')
Line 493 ish: $this->data['tab_field'] = array(
Add 'cost' to the tab you want it to appear (e.g under 'Data' is most likely the tab it is in in the product edit/add screen).
Finally around line: 1227: $this->prod_data = array(
Add a 'cost' => '' entry to the array
Assuming 'cost' is the name of your field in the database that should be all that is required, I may be slightly off as I do not have a cost field install to test this on as I am writing but the above should basically do it =)
Here is a brief rundown of what would be required for a new field (like cost).
In the controller/tool/total_import.php file.
Line 434 ish: $this->data['field_map'] = array(
Add a 'cost' entry with the appropriate string (can use language file load or just a flat string like 'Cost')
Line 493 ish: $this->data['tab_field'] = array(
Add 'cost' to the tab you want it to appear (e.g under 'Data' is most likely the tab it is in in the product edit/add screen).
Finally around line: 1227: $this->prod_data = array(
Add a 'cost' => '' entry to the array
Assuming 'cost' is the name of your field in the database that should be all that is required, I may be slightly off as I do not have a cost field install to test this on as I am writing but the above should basically do it =)
Mods: Total Import PRO | Any Feed PRO | XML Input PRO |
CSV Import PRO
Thanks for this but for some reason I can;t get it to work,hostjars wrote:Hey James,
Here is a brief rundown of what would be required for a new field (like cost).
In the controller/tool/total_import.php file.
Line 434 ish: $this->data['field_map'] = array(
Add a 'cost' entry with the appropriate string (can use language file load or just a flat string like 'Cost')
Line 493 ish: $this->data['tab_field'] = array(
Add 'cost' to the tab you want it to appear (e.g under 'Data' is most likely the tab it is in in the product edit/add screen).
Finally around line: 1227: $this->prod_data = array(
Add a 'cost' => '' entry to the array
Assuming 'cost' is the name of your field in the database that should be all that is required, I may be slightly off as I do not have a cost field install to test this on as I am writing but the above should basically do it =)
Everything is there up to Step 4. I can see the field and I can map it but it never imports the value into the database column.
Any suggestions?
Thanks for that post hostjars. I still can't get the additional column to import. Everything works up to Step 4. I can see the field value in the sample feed, and can map it to the right column. But the value doesn't import into the database. Am I missing something? Has the process changed since this was posted.
Handy help guys!
For those that need the following:
We needed to set the quantity of products with 1 till 5 on stock to zero.
With this code you can do that.
Place the code before "//ADMIN STEP 3: MODIFY DATA"
Now we try to do something with the price.
The multiplier aloows you to markup the price with only one markup %.
We are trying to do something like:
0 - 10 euro, add 5 euro
10-25 euro, add 6 euro
25-50 euro, add 7.50 euro
and so on.
We tried the code:
But with this code you can not set more then one markup.
We keep trying but help is always oke
For those that need the following:
We needed to set the quantity of products with 1 till 5 on stock to zero.
With this code you can do that.
Place the code before "//ADMIN STEP 3: MODIFY DATA"
Code: Select all
//stocksetting
foreach (array('quantity') as $quantity) {
$raw_prod[$this->field_names[$quantity]] = str_replace('1', '0', $raw_prod[$this->field_names[$quantity]]);
$raw_prod[$this->field_names[$quantity]] = str_replace('2', '0', $raw_prod[$this->field_names[$quantity]]);
$raw_prod[$this->field_names[$quantity]] = str_replace('3', '0', $raw_prod[$this->field_names[$quantity]]);
$raw_prod[$this->field_names[$quantity]] = str_replace('4', '0', $raw_prod[$this->field_names[$quantity]]);
$raw_prod[$this->field_names[$quantity]] = str_replace('5', '0', $raw_prod[$this->field_names[$quantity]]);
$raw_prod[$this->field_names[$quantity]] = str_replace('yes', '6', $raw_prod[$this->field_names[$quantity]]);
$raw_prod[$this->field_names[$quantity]] = str_replace('no', '0', $raw_prod[$this->field_names[$quantity]]);
}
The multiplier aloows you to markup the price with only one markup %.
We are trying to do something like:
0 - 10 euro, add 5 euro
10-25 euro, add 6 euro
25-50 euro, add 7.50 euro
and so on.
We tried the code:
Code: Select all
if (($raw_prod[$this->field_names['price']]) <10) {
$raw_prod[$this->field_names['price']] = ($raw_prod[$this->field_names['price']] + 5)*1.21;
}
We keep trying but help is always oke
Live store Opencart 2.3.0.2 modified on https://webshopmarlin.nl
@marlin.nl
Hello.
if (($raw_prod[$this->field_names['price']]) <10) {
$raw_prod[$this->field_names['price']] = ($raw_prod[$this->field_names['price']] + 5)*1.21;
}
Did you find the solution for that? Is something that we want it too.
Thanks.
Hello.
if (($raw_prod[$this->field_names['price']]) <10) {
$raw_prod[$this->field_names['price']] = ($raw_prod[$this->field_names['price']] + 5)*1.21;
}
Did you find the solution for that? Is something that we want it too.
Thanks.
Who is online
Users browsing this forum: No registered users and 9 guests