public function processAllTextShortcodes($post_id, $tpl_html, $max_length = false, $ItemObj = false) { // get item object $listing_id = WPLE_ListingQueryHelper::getListingIDFromPostID($post_id); $item = ListingsModel::getItem($listing_id); // main content - [[product_content]] (unless updating title when saving product...) if (!isset($_REQUEST['action']) || $_REQUEST['action'] != 'editpost' || isset($_REQUEST['wpl_ebay_revise_on_update']) || isset($_REQUEST['wpl_ebay_relist_on_update'])) { $tpl_html = $this->processMainContentShortcode($post_id, $tpl_html, $item); } // product excerpt $product_id = $item['parent_id'] ? $item['parent_id'] : $item['post_id']; // maybe use parent post_id (for split variations) $tpl_html = str_replace('[[product_excerpt]]', WPLE_ListingQueryHelper::getRawPostExcerpt($product_id), $tpl_html); $tpl_html = str_replace('[[product_excerpt_nl2br]]', nl2br(WPLE_ListingQueryHelper::getRawPostExcerpt($product_id)), $tpl_html); $tpl_html = str_replace('[[product_additional_content]]', wpautop(WPLE_ListingQueryHelper::getRawPostExcerpt($product_id)), $tpl_html); $tpl_html = str_replace('[[product_additional_content_nl2br]]', nl2br(WPLE_ListingQueryHelper::getRawPostExcerpt($product_id)), $tpl_html); // product price $item_price = $item['price']; if ($ItemObj && $ItemObj->StartPrice) { $item_price = $ItemObj->StartPrice->value; } if ($ItemObj && $ItemObj->Variations) { $item_price = $ItemObj->Variations->Variation[0]->StartPrice; } $tpl_html = str_replace('[[product_price]]', number_format_i18n(floatval($item_price), 2), $tpl_html); $tpl_html = str_replace('[[product_price_raw]]', $item_price, $tpl_html); // product_category $tpl_html = str_replace('[[product_category]]', ProductWrapper::getProductCategoryName($post_id), $tpl_html); // SKU $tpl_html = str_replace('[[product_sku]]', ProductWrapper::getSKU($post_id), $tpl_html); // weight $tpl_html = str_replace('[[product_weight]]', ProductWrapper::getWeight($post_id, true), $tpl_html); // dimensions $dimensions = ProductWrapper::getDimensions($post_id); $width = @$dimensions['width'] . ' ' . @$dimensions['width_unit']; $height = @$dimensions['height'] . ' ' . @$dimensions['height_unit']; $length = @$dimensions['length'] . ' ' . @$dimensions['length_unit']; $tpl_html = str_replace('[[product_width]]', $width, $tpl_html); $tpl_html = str_replace('[[product_height]]', $height, $tpl_html); $tpl_html = str_replace('[[product_length]]', $length, $tpl_html); // attributes $tpl_html = $this->processAttributeShortcodes($post_id, $tpl_html, $max_length); // custom meta $tpl_html = $this->processCustomMetaShortcodes($post_id, $tpl_html, $max_length); return $tpl_html; }