本文整理汇总了PHP中wpsc_product_external_link函数的典型用法代码示例。如果您正苦于以下问题:PHP wpsc_product_external_link函数的具体用法?PHP wpsc_product_external_link怎么用?PHP wpsc_product_external_link使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wpsc_product_external_link函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: wpsc_product_external_link
}
?>
<!-- END OF QUANTITY OPTION -->
<?php
if (get_option('hide_addtocart_button') == 0 && get_option('addtocart_or_buynow') != '1') {
?>
<?php
if (wpsc_product_has_stock()) {
?>
<?php
if (wpsc_product_external_link(wpsc_the_product_id()) != '') {
?>
<?php
$action = wpsc_product_external_link(wpsc_the_product_id());
?>
<input class="wpsc_buy_button" type='button' value='<?php
echo __('Buy Now', 'wpsc');
?>
' onclick='gotoexternallink("<?php
echo $action;
?>
")'>
<?php
} else {
?>
<input type='image' src='<?php
echo WPSC_URL;
?>
/themes/iShop/images/buy_button.gif' id='product_<?php
开发者ID:Jonathonbyrd,项目名称:wp-ecommerce,代码行数:31,代码来源:single_product.php
示例2: wpsc_get_form_action
/**
* wpsc_get_form_action
*
* Return the form action for use in the template files
*
* @global <type> $wpec_form_action
* @return <type>
*/
function wpsc_get_form_action()
{
global $wpec_form_action;
$product_id = wpsc_the_product_id();
// Function has already ran in this page load
if (isset($wpec_form_action)) {
$action = $wpec_form_action;
// No global so figure it out
} else {
// Use external if set
if (wpsc_is_product_external()) {
$action = wpsc_product_external_link($product_id);
// Otherwise use this page
} else {
$action = wpsc_this_page_url();
}
}
// Return form action
return $action;
}
开发者ID:AngryBird3,项目名称:WP-e-Commerce,代码行数:28,代码来源:template-tags.php
示例3: wpsc_product_external_link
<?php
}
?>
<?php
if (get_option('hide_addtocart_button') == 0 && get_option('addtocart_or_buynow') != '1') {
?>
<?php
if (wpsc_product_has_stock()) {
?>
<?php
if (wpsc_product_external_link($product_id) != '') {
?>
<?php
$action = wpsc_product_external_link($product_id);
?>
<button class="button big active"
onclick="return gotoexternallink('<?php
echo $action;
?>
', '<?php
echo wpsc_product_external_link_target($product_id);
?>
')">
<span><?php
echo wpsc_product_external_link_text($product_id, __('Buy Now', ETHEME_DOMAIN));
?>
</span>
</button>
<?php
开发者ID:Nguyenkain,项目名称:hanghieusales,代码行数:31,代码来源:wpsc-single_product.php
示例4: wpsc_is_product_external
/**
* wpsc_is_product_external( $product_id = 0 )
*
* Checks if current product is external.
*
* @param int $product_id
*/
function wpsc_is_product_external($product_id = 0)
{
// Get product ID if incorrect value was passed
if (empty($product_id) || !is_numeric($product_id)) {
$product_id = wpsc_the_product_id();
}
// Get external link
$external_link = wpsc_product_external_link($product_id);
// Use external if set
if (!empty($external_link)) {
return true;
} else {
return false;
}
}
开发者ID:arturo-mayorga,项目名称:am_com,代码行数:22,代码来源:product-template.php
示例5: etheme_create_slider
/**
* Create product slider getting query
*/
function etheme_create_slider($args, $title = false, $image_width = 220, $image_height = 220, $crop = false)
{
global $wpdb;
$box_id = rand(1000, 10000);
$multislides = new WP_Query($args);
if ($multislides->have_posts()) {
if ($title) {
$title_output = '<h2 class="slider-title">' . $title . '</h2>';
}
echo '<div class="product-slider">';
echo $title_output;
echo '<div class="clear"></div>';
echo '<div class="carousel">';
echo '<div class="slider">';
$_i = 0;
while ($multislides->have_posts()) {
$multislides->the_post();
$_i++;
if (class_exists('Woocommerce')) {
global $product;
if (!$product->is_visible()) {
continue;
}
echo '<div class="slide product-slide ' . $last . '">';
woocommerce_get_template_part('content', 'product');
echo '</div><!-- slide -->';
}
if (class_exists('WP_eCommerce')) {
$post_id = get_the_ID();
$post_name = get_the_title();
$post_image = etheme_get_image(null, $image_width, $image_height, $crop, $post_id);
if (!$post_image && $image_default) {
$post_image = $image_default;
}
$post_url = get_permalink();
if (class_exists('WP_eCommerce')) {
$normal_price = class_exists('WP_eCommerce') ? the_product_price($post_id) : false;
$post_price = class_exists('WP_eCommerce') ? the_product_price($post_id, true) : '';
}
echo '<div class="slide product-slide ' . $last . '">';
echo '<a href="' . $post_url . '" class="product-image"><div class="img-wrapper"><img alt="" src="' . $post_image . '" /></div></a>';
echo '<span class="product-name"><a href="' . $post_url . '">' . esc_attr($post_name) . '</a></span>';
if ($normal_price != $post_price) {
echo '<div class="price sale">';
echo '<p class="oldprice-p pricedisplay"><span class="oldprice">' . $normal_price . '</span></p>';
echo '<p class="pricedisplay"><span class="currentprice pricedisplay">' . $post_price . '</span></p>';
echo '</div> ';
} else {
echo '<div class="price">';
echo '<span>' . $post_price . '</span>';
echo '</div>';
}
wpsc_the_product();
if (wpsc_product_external_link($post_id) != '') {
$action = wpsc_product_external_link($post_id);
} else {
$action = htmlentities(wpsc_this_page_url(), ENT_QUOTES, 'UTF-8');
}
echo '<div class="btn-cont">';
echo '<form class="product_form" enctype="multipart/form-data" action="' . $action . '" method="post" name="product_' . $post_id . '" id="product_' . $post_id . '" >';
echo '<input type="hidden" value="add_to_cart" name="wpsc_ajax_action"/>';
echo '<input type="hidden" value="' . $post_id . '" name="product_id"/>';
if (false) {
echo '<button class="button" type="submit" id="product_' . $post_id . '_submit_button"><span>' . __('Add To Cart', 'wpsc') . '</span></button>';
} else {
echo '<a href="' . $post_url . '" class="button add-to-cart sml"><span>' . __('Read more', 'wpsc') . '</span></a>';
}
echo '</form>';
echo '</div>';
echo '</div><!-- slide -->';
}
unset($last);
}
echo '</div><!-- slider -->';
echo '</div><!-- carousel -->';
if ($_i > 1) {
echo '<div class="prev arrow' . $box_id . '" style="cursor: pointer; "> </div>';
echo '<div class="next arrow' . $box_id . '" style="cursor: pointer; "> </div>';
}
echo '</div><!-- product-slider -->';
}
wp_reset_query();
if (@$_i > 1) {
echo '
<script type="text/javascript">
jQuery(".arrow' . $box_id . '.prev").addClass("disabled");
jQuery(".carousel").iosSlider({
desktopClickDrag: true,
snapToChildren: true,
infiniteSlider: false,
navNextSelector: ".arrow' . $box_id . '.next",
navPrevSelector: ".arrow' . $box_id . '.prev",
lastSlideOffset: 3,
onFirstSlideComplete: function(){
jQuery(".arrow' . $box_id . '.prev").addClass("disabled");
},
onLastSlideComplete: function(){
//.........这里部分代码省略.........
开发者ID:Nguyenkain,项目名称:hanghieusales,代码行数:101,代码来源:products.php
注:本文中的wpsc_product_external_link函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论