本文整理汇总了PHP中producthelper::getProductSubscriptionDetail方法的典型用法代码示例。如果您正苦于以下问题:PHP producthelper::getProductSubscriptionDetail方法的具体用法?PHP producthelper::getProductSubscriptionDetail怎么用?PHP producthelper::getProductSubscriptionDetail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类producthelper
的用法示例。
在下文中一共展示了producthelper::getProductSubscriptionDetail方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
if ($product_image_path) {
$thumbUrl = RedShopHelperImages::getImagePath($product_image_path, '', 'thumb', 'product', CART_THUMB_WIDTH, CART_THUMB_HEIGHT, USE_IMAGE_SIZE_SWAPPING);
$product_image = "<div class='product_image'><img src='" . $thumbUrl . "'></div>";
} else {
$product_image = "<div class='product_image'></div>";
}
$cart_mdata = str_replace("{product_name}", $product_name, $template_middle);
$cart_mdata = str_replace("{product_thumb_image}", $product_image, $cart_mdata);
$cart_mdata = str_replace("{product_attribute}", $OrderProducts[$i]->product_attribute, $cart_mdata);
$cart_mdata = str_replace("{product_accessory}", $OrderProducts[$i]->product_accessory, $cart_mdata);
$cart_mdata = str_replace("{product_wrapper}", '', $cart_mdata);
$cart_mdata = str_replace("{product_number}", $product_number, $cart_mdata);
$cart_mdata = str_replace("{product_number_lbl}", JText::_('COM_REDSHOP_PRODUCT_NUMBER'), $cart_mdata);
$user_subscribe_detail = $producthelper->getUserProductSubscriptionDetail($OrderProducts[$i]->order_item_id);
if (count($user_subscribe_detail) > 0 && $user_subscribe_detail->subscription_id) {
$subscription_detail = $producthelper->getProductSubscriptionDetail($OrderProducts[$i]->product_id, $user_subscribe_detail->subscription_id);
$selected_subscription = $subscription_detail->subscription_period . " " . $subscription_detail->period_type;
$cart_mdata = str_replace("{product_subscription_lbl}", JText::_('COM_REDSHOP_SUBSCRIPTION'), $cart_mdata);
$cart_mdata = str_replace("{product_subscription}", $selected_subscription, $cart_mdata);
} else {
$cart_mdata = str_replace("{product_subscription_lbl}", "", $cart_mdata);
$cart_mdata = str_replace("{product_subscription}", "", $cart_mdata);
}
$cart_mdata = str_replace("{product_userfields}", $product_userfields, $cart_mdata);
$cart_mdata = str_replace("{product_note}", $product_note, $cart_mdata);
$cart_mdata = str_replace("{product_price}", $product_price, $cart_mdata);
$cart_mdata = str_replace("{product_quantity}", $product_quantity, $cart_mdata);
$cart_mdata = str_replace("{product_total_price}", $product_total_price, $cart_mdata);
$cart_tr .= $cart_mdata;
}
$ordersprint_template = $template_start . $cart_tr . $template_end;
示例2: sendSubscriptionRenewalMail
function sendSubscriptionRenewalMail($data = array())
{
$app = JFactory::getApplication();
$producthelper = new producthelper();
$redconfig = new Redconfiguration();
$MailFrom = $app->getCfg('mailfrom');
$FromName = $app->getCfg('fromname');
$SiteName = $app->getCfg('sitename');
$user_email = "";
$firstname = "";
$lastname = "";
$maildata = "";
$mailsubject = "";
$mailbcc = null;
$mailtemplate = $this->getMailtemplate(0, "subscription_renewal_mail");
if (count($mailtemplate) > 0) {
$mailtemplate = $mailtemplate[0];
$maildata = $mailtemplate->mail_body;
$mailsubject = $mailtemplate->mail_subject;
if (trim($mailtemplate->mail_bcc) != "") {
$mailbcc = explode(",", $mailtemplate->mail_bcc);
}
} else {
return false;
}
$userdata = $this->_order_functions->getBillingAddress($data->user_id);
if (count($userdata) > 0) {
$user_email = $userdata->user_email;
$firstname = $userdata->firstname;
$lastname = $userdata->lastname;
}
$product = $producthelper->getProductById($data->product_id);
$productSubscription = $producthelper->getProductSubscriptionDetail($data->product_id, $data->subscription_id);
$search = array();
$replace = array();
$search[] = "{shopname}";
$search[] = "{firstname}";
$search[] = "{lastname}";
$search[] = "{product_name}";
$search[] = "{subsciption_enddate}";
$search[] = "{subscription_period}";
$search[] = "{subscription_price}";
$search[] = "{product_link}";
$replace[] = SHOP_NAME;
$replace[] = $firstname;
$replace[] = $lastname;
$replace[] = $product->product_name;
$replace[] = $redconfig->convertDateFormat($data->end_date);
$replace[] = $productSubscription->subscription_period . " " . $productSubscription->period_type;
$replace[] = $producthelper->getProductFormattedPrice($productSubscription->subscription_price);
$producturl = JURI::root() . 'index.php?option=com_redshop&view=product&pid=' . $data->product_id;
$replace[] = "<a href='" . $producturl . "'>" . $product->product_name . "</a>";
$maildata = str_replace($search, $replace, $maildata);
$mailsubject = str_replace($search, $replace, $mailsubject);
if ($user_email != "") {
JUtility::sendMail($MailFrom, $FromName, $user_email, $mailsubject, $maildata, 1, null, $mailbcc);
}
return true;
}