Active
Project:
Ubercart Restricted Shipping
Version:
6.x-1.0
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
25 Jul 2010 at 21:13 UTC
Updated:
25 Jul 2010 at 21:13 UTC
Hello,
I uncommented theme_uc_restrict_shipping and modified code a little bit:
function theme_uc_restrict_shipping($node) {
$unshippable = array();
if ($node->rs_data) {
if ($node->rs_mode == 0) {
foreach ($node->rs_data as $country => $state) {
if ($state == 0) {
$unshippable[] = $country;
}
}
} elseif ($node->rs_mode == 1) {
foreach ($node->rs_data as $country => $state) {
if ($state == 1) {
$unshippable[] = $country;
}
}
}
}
if (!empty($unshippable)) {
$country_names = array();
$result = db_query("SELECT country_name FROM {uc_countries} WHERE country_id IN (%s) ORDER BY country_name ASC", implode(',', $unshippable));
while ($row = db_fetch_object($result)) {
$country_names[] = $row->country_name;
}
$rs_unshippable = implode(', ', $country_names);
$output = t('This product is not shippable to: !countries.', array('!countries' => '<span>' . $rs_unshippable . '</span>'));
return '<div class="uc_restrict_shipping">'. $output .'</div>';
} else {
return '<div class="uc_restrict_shipping">This item is not restricted for shipping.</div>';
}
}
Unfortunately, I cannot see any
Also, I would like to display shippable countries.
This is always better to have a positive display.