PDA

View Full Version : Easypopulate situation



bkpie
12-29-2005, 10:05 PM
I started using easy populate and here is the problem I am perplexed on. I uncommented the lines as stated for seperate pricing for customers in easypopulate.php but now if you download a complete tab delimited text file there is no place for the customer group prices. But if you download the model/price/quantity file then the places for your all your customer group prices are there. How do you get it to work with the complete file?? Your help will be greatly appreciated.

bkpie
01-08-2006, 10:33 AM
Ok thanks to Dcmo and Theengel in a couple different posts this is resolved and I will try and make it easier to find the code in oscmax v2.

File to edit catalog/admin/easypopulate.php

1st around line 1039 uncomment the number of pricing groups you are using.(uncomment meaning remove pound sign) In my case I am using 2 additional wholesale pricing groups in addition to the original retail pricing group. So the code would look like this.


'v_products_model' => $iii++,
'v_products_price' => $iii++,
'v_products_quantity' => $iii++,
'v_customer_price_1' => $iii++,
'v_customer_group_id_1' => $iii++,
'v_customer_price_2' => $iii++,
'v_customer_group_id_2' => $iii++,
#'v_customer_price_3' => $iii++,
#'v_customer_group_id_3' => $iii++,
#'v_customer_price_4' => $iii++,
#'v_customer_group_id_4' => $iii++,
);

Second add the groups you are using in my case using 2 extra groups. If you are using more price groups they will need to be added to my example.
Find this code around line 942

// VJ product attribs begin
$header_array = array(
'v_products_price' => $iii++,
'v_products_weight' => $iii++,
'v_date_avail' => $iii++,
'v_date_added' => $iii++,
'v_products_quantity' => $iii++,
);
and replace with
// VJ product attribs begin
$header_array = array(
'v_products_price' => $iii++,
'v_customer_price_1' => $iii++,
'v_customer_group_id_1' => $iii++,
'v_customer_price_2' => $iii++,
'v_customer_group_id_2' => $iii++,
'v_products_weight' => $iii++,
'v_date_avail' => $iii++,
'v_date_added' => $iii++,
'v_products_quantity' => $iii++,
);

Remember I am using 2 groups if you are using 3 or 4 they will need to be added to the above code.

Last step is your table. Find this code around line 1896
'.TABLE_PRODUCTS_GROUPS.'
VALUES
(
' . $v_customer_group_id_1 . ',
' . $v_customer_price_1 . ',
' . $v_products_id . ',
' . $v_products_price .'
)'
);
}
if ($v_customer_price_2 != ''){
$result = tep_db_query('
INSERT INTO
'.TABLE_PRODUCTS_GROUPS.'
VALUES
(
' . $v_customer_group_id_2 . ',
' . $v_customer_price_2 . ',
' . $v_products_id . ',
' . $v_products_price . '
)'
);
}
if ($v_customer_price_3 != ''){
$result = tep_db_query('
INSERT INTO
'.TABLE_PRODUCTS_GROUPS.'
VALUES
(
' . $v_customer_group_id_3 . ',
' . $v_customer_price_3 . ',
' . $v_products_id . ',
' . $v_products_price . '
)'
);
}
if ($v_customer_price_4 != ''){
$result = tep_db_query('
INSERT INTO
'.TABLE_PRODUCTS_GROUPS.'
VALUES
(
' . $v_customer_group_id_4 . ',
' . $v_customer_price_4 . ',
' . $v_products_id . ',
' . $v_products_price . '
)'
);
}

}
and remove the ,
' . $v_products_price . ' this includes the comma after previous entry so it looks like this.

'.TABLE_PRODUCTS_GROUPS.'
VALUES
(
' . $v_customer_group_id_1 . ',
' . $v_customer_price_1 . ',
' . $v_products_id . ' )'
);
}
if ($v_customer_price_2 != ''){
$result = tep_db_query('
INSERT INTO
'.TABLE_PRODUCTS_GROUPS.'
VALUES
(
' . $v_customer_group_id_2 . ',
' . $v_customer_price_2 . ',
' . $v_products_id . ' )'
);
}
if ($v_customer_price_3 != ''){
$result = tep_db_query('
INSERT INTO
'.TABLE_PRODUCTS_GROUPS.'
VALUES
(
' . $v_customer_group_id_3 . ',
' . $v_customer_price_3 . ',
' . $v_products_id . ' )'
);
}
if ($v_customer_price_4 != ''){
$result = tep_db_query('
INSERT INTO
'.TABLE_PRODUCTS_GROUPS.'
VALUES
(
' . $v_customer_group_id_4 . ',
' . $v_customer_price_4 . ',
' . $v_products_id . ' )'
);
}

} Thats it now you can use the complete tab delimited text file to edit all your pricing as well as attributes.