Closed (fixed)
Project:
e-Commerce
Version:
5.x-3.0
Component:
flexicharge
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
28 Mar 2007 at 02:57 UTC
Updated:
26 Jul 2007 at 02:48 UTC
Jump to comment: Most recent file
Hi,
I set up a site-wide flexicharge called "Flat postage fee" for my apparel products, but it's not showing up in the order summary. I have no other shipping options configured.
Any idea what could be wrong? I am using Drupal 5.1 with the latest CVS version of Ecommerce.
Thanks in advance!
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | flexicharge_1.patch | 2.21 KB | Rok Žlender |
Comments
Comment #1
slombardi commentedHi
I'm having the same problem as well.
Couldn't find any suggestion in topics on flexicharge.
Does anyone have any Idea on this?
thanks..
Comment #2
Bob445 commentedHello,
I'm having the same problem.
Someone have solution to fix it ?
Thanks
Comment #3
slayerment commentedDo you have a region enabled for it or have the checkbox checked for this region? I know I was having this same problem because I forgot to check that...
Comment #4
Bob445 commentedFor me it's fixed, I don't know why ...
Comment #5
hanskuiters commentedI have the regions module enabled but do not use it.
Setting a flexicharge works fine, it shows in checkout and does what it has to do.
After changing the flexicharge-setting it is not showing anymore in checkout.
When creating a new setting, it shows again in checkout.
Comment #6
mutzel commented"I have the regions module enabled but do not use it.
Setting a flexicharge works fine, it shows in checkout and does what it has to do.
After changing the flexicharge-setting it is not showing anymore in checkout.
When creating a new setting, it shows again in checkout."
same problem for me too! any solutions yet?
a new simple shipping creates a visible charge of 0 at the checkout but after editing it is not visible anymore
Comment #7
mutzel commentedFor me it's fixed, I do know why ... :D
You need to select the "Product types".
So i assume that the description of "Product types" is incorrect:
"Please choose the products that this charge applies to. No selection indicates all products. Charge will apply only once, if any product in the cart matches this list."
Comment #8
brmassa commentedGuys,
Martin was right: the product types field is REQUIRED. you have to choose all product types if you need to. (its only needed if you edited you flexicharge, because the buggy code ignores it when you create one and dont edit it)
or the description should be changed or a new patch should be done:
best regards,
massa
Comment #9
slombardi commentedHi..
I changed those settings selecting the product types I needed (and also the user roles) but shipping still disp could it be?
says a 0 in the final invoice...
Help!
Does anyone have an idea on what it could be?
thanks
Comment #10
slombardi commentedHi..
I changed those settings selecting the product types I needed (and also the user roles) but shipping still disp could it be?
says a 0 in the final invoice...
Help!
Does anyone have an idea on what it could be?
thanks
Comment #11
vegera commentedHello!
I found 2 errors in the flexicharge module.
#1 missing 'hide_if_zero' field in the insert into sql command. The result: ptype field is in bad place at the ec_flexicharge table.
#2 role error in the checkoutapi function:
$charge->roles return with rids (roles ids), but the $user->roles return with the role-names. Ofcourse array_intersect($user->roles, $charge->roles)) function return with no score.
Possible (not to good) solution for me:
$all_roles= user_roles();
foreach($charge->roles AS $charge_rid)
{$charge_roles[$charge_rid]=$all_roles[$charge_rid];}
// Check if any roles match the filter.
if (is_array($charge->roles) && !count(array_intersect($user->roles, $charge_roles))) {
unset($charges[$charge->chid]);
}
}
Sorry for my horrible english.
Joe Vegera
Comment #12
jeremdow commentedvegera -
Thanks - your user role fix worked for us also.
We also had to make some changes to the update and insert statements in the flexicharge_admin_form_submit function to include hide_if_zero and reorder the sequence to prevent the user roles from being miscarried.
Code below - again worked for us, but no guarantees :)
function flexicharge_admin_form_submit($form_id, $form) {
// Get the form elements required by the charge provider
$f = $provider .'_flexicharge_form_validate';
if (function_exists($f)) {
$form = $f($form_id, $form);
}
$settings = array();
if (isset($form['elements'])) {
foreach($form['elements'] AS $fieldset) {
$settings = array_merge($fieldset, $settings);
}
$settings = serialize($settings);
}
else {
$settings = '';
}
$ptypes = serialize($form['module']['ptypes']);
$roles = serialize($form['module']['roles']);
if ($form['module']['chid']) {
db_query("UPDATE {ec_flexicharge} SET display = '%s', operator = %d, rate = %f, position = %d, subtotal_before = %d, subtotal_after = %d, already_added = %d, hide_if_zero = %d, ptypes = '%s', roles = '%s', settings = '%s' WHERE chid = %d",
$form['module']['display'], $form['module']['operator'],
$form['module']['rate'], $form['module']['position'],
$form['module']['subtotal_before'], $form['module']['subtotal_after'],
$form['module']['already_added'], $form['module']['hide_if_zero'],
$ptypes, $roles, $settings, $form['module']['chid']);
}
else {
db_query("INSERT INTO {ec_flexicharge}
( provider, method, display,
operator, rate, position,
subtotal_before, subtotal_after,
already_added, hide_if_zero, ptypes, roles, settings)
VALUES ('%s', '%s', '%s', %d, %f, %d, %d, %d, %d, %d, '%s', '%s', '%s')",
$form['module']['provider'], $form['module']['method'],
$form['module']['display'], $form['module']['operator'],
$form['module']['rate'], $form['module']['position'],
$form['module']['subtotal_before'], $form['module']['subtotal_after'],
$form['module']['already_added'], $form['module']['hide_if_zero'],
$ptypes, $roles, $settings);
}
drupal_set_message(t('The charge has been saved.'));
drupal_goto('admin/ecsettings/flexicharge');
}
Only the SQL statements were modified from the original code, but I included the whole function for context.
Cheers,
JMD
Comment #13
jeremdow commentedTo follow up - I also had to add this after the call to _flexicharge_partners in order for hide if zero to work.
JMD
Comment #14
Rok Žlender commentedI created a patch that includes #12 and #11. It works for me.
#13 didn't work for me bacause function general_*_flexicharge_calculate does not exist. Jeremdow if you can maybe create a patch or explain your code a bit.
Comment #15
slombardi commentedHi,
could you please post the patched files as I'm not able to run patches as I have no access to shell
Thanks in advance
S
Comment #16
brmassa commentedGuys,
fixed on EC4.
the solution, however, was not the providided. to port to EC3, take a look on http://cvs.drupal.org/viewcvs/drupal/contributions/modules/ecommerce/con...
regards,
massa
Comment #17
brmassa commentedits a bug
Comment #18
gordon commentedI have backported this to 4.7.x-3.0-dev and 5.x-3.x-dev
Comment #19
(not verified) commented