[英]How to change ubercart add to cart button to image[Drupal 7]?
Thanks 谢谢
we use in drupal 7 ubercart 3. here we use this function for update cart page. 我们在drupal 7 ubercart 3中使用。在这里,我们将此功能用于更新购物车页面。
This is answer of 2 question. 这是2个问题的答案。
** hook_form_uc_cart_view_form_alter**. ** hook_form_uc_cart_view_form_alter **。 we got a solution .
我们有一个解决方案。
implementation like..
function modulename_form_uc_cart_view_form_alter(&$form, &$form_state) {
if (count($form['items'])) {
// Add edit column to tapir table.
$form['items']['#columns']['unit'] = array(
'cell' => t('Unit Price'),
'weight' => 2,
);
// Add edit link to all products.
foreach (element_children($form['items']) as $key) {
if (isset($form['items'][$key]['cart_item_id'])) {
$form['items'][$key]['unit'] = array(
'#markup' =>t(uc_currency_format(sprintf ("%.2f", $form['items'][$key]['#entity']->sell_price ))),
);
}
}
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.