Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 17

Thread: CSS alignment

  1. #1
    New Coder
    Join Date
    Jan 2010
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    CSS alignment

    Hello, hope everybody is ok, im having trouble with a client site,

    http://www.carlssonxpresstabsltd.co....inted-2-holes/

    i need the "add to cart" button to be on the same like as the title, the cost and quantity.

    the page that needs editing is

    <?php
    global $wpsc_query, $wpdb;
    ?>
    <div id='products_page_container' class="wrap wpsc_container">

    <?php if(wpsc_has_breadcrumbs()) : ?>
    <div class='breadcrumb'>
    <a href='<?php echo get_option('home'); ?>'><?php echo get_option('blogname'); ?></a> &raquo;
    <?php while (wpsc_have_breadcrumbs()) : wpsc_the_breadcrumb(); ?>
    <?php if(wpsc_breadcrumb_url()) :?>
    <a href='<?php echo wpsc_breadcrumb_url(); ?>'><?php echo wpsc_breadcrumb_name(); ?></a> &raquo;
    <?php else: ?>
    <?php echo wpsc_breadcrumb_name(); ?>
    <?php endif; ?>
    <?php endwhile; ?>
    </div>
    <?php endif; ?>

    <?php do_action('wpsc_top_of_products_page'); // Plugin hook for adding things to the top of the products page, like the live search ?>

    <?php if(wpsc_display_categories()): ?>
    <?php if(get_option('wpsc_category_grid_view') == 1) :?>
    <div class='wpsc_categories wpsc_category_grid'>
    <?php wpsc_start_category_query(array('category_group'=> get_option('wpsc_default_category'), 'show_thumbnails'=> 1)); ?>
    <a href="<?php wpsc_print_category_url();?>" class="wpsc_category_grid_item" title='<?php wpsc_print_category_name();?>'>
    <?php wpsc_print_category_image(45, 45); ?>
    </a>
    <?php wpsc_print_subcategory("", ""); ?>
    <?php wpsc_end_category_query(); ?>
    <div class='clear_category_group'></div>
    </div>
    <?php else:?>
    <ul class='wpsc_categories'>
    <?php wpsc_start_category_query(array('category_group'=> get_option('wpsc_default_category'), 'show_thumbnails'=> get_option('show_category_thumbnails'))); ?>
    <li>
    <?php wpsc_print_category_image(32, 32); ?>

    <a href="<?php wpsc_print_category_url();?>" class="wpsc_category_link"><?php wpsc_print_category_name();?></a>
    <?php if(get_option('wpsc_category_description')) :?>
    <?php wpsc_print_category_description("<div class='wpsc_subcategory'>", "</div>"); ?>
    <?php endif;?>

    <?php wpsc_print_subcategory("<ul>", "</ul>"); ?>
    </li>
    <?php wpsc_end_category_query(); ?>
    </ul>
    <?php endif; ?>
    <?php endif; ?>




    <?php if(wpsc_display_products()): ?>
    <?php if(wpsc_is_in_category()) : ?>
    <div class='wpsc_category_details'>
    <?php if(get_option('show_category_thumbnails') && wpsc_category_image()) : ?>
    <img src='<?php echo wpsc_category_image(); ?>' alt='<?php echo wpsc_category_name(); ?>' title='<?php echo wpsc_category_name(); ?>' />
    <?php endif; ?>

    <?php if(get_option('wpsc_category_description') && wpsc_category_description()) : ?>
    <?php echo wpsc_category_description(); ?>
    <?php endif; ?>
    </div>
    <?php endif; ?>


    <!-- Start Pagination -->
    <?php if ( ( get_option( 'use_pagination' ) == 1 && ( get_option( 'wpsc_page_number_position' ) == 1 || get_option( 'wpsc_page_number_position' ) == 3 ) ) ) : ?>
    <div class="wpsc_page_numbers">
    <?php if ( wpsc_has_pages() ) : ?>
    Pages: <?php echo wpsc_first_products_link( '&laquo; First', true ); ?> <?php echo wpsc_previous_products_link( '&laquo; Previous', true ); ?> <?php echo wpsc_pagination( 10 ); ?> <?php echo wpsc_next_products_link( 'Next &raquo;', true ); ?> <?php echo wpsc_last_products_link( 'Last &raquo;', true ); ?>
    <?php endif; ?>
    </div>
    <?php endif; ?>
    <!-- End Pagination -->


    <table class="list_productdisplay <?php echo wpsc_category_class(); ?>">
    <?php /** start the product loop here */?>
    <?php $alt = 0; ?>
    <?php while (wpsc_have_products()) : wpsc_the_product(); ?>
    <?php
    $alt++;
    if ($alt %2 == 1) { $alt_class = 'alt'; } else { $alt_class = ''; }
    ?>
    <tr class="product_view_<?php echo wpsc_the_product_id(); ?> <?php echo $alt_class;?>">


    <td width="30%">
    <a class="wpsc_product_title" href="<?php echo wpsc_the_product_permalink(); ?>">
    <strong><?php echo wpsc_the_product_title(); ?></strong>
    </a>
    </td>

    <td width="10" style="text-align: center;">
    <?php if(wpsc_product_has_stock()) : ?>
    <img src="<?php echo WPSC_URL; ?>/images/yes_stock.gif" alt="Yes" title="Yes" style="margin-top: 4px;"/>
    <?php else: ?>
    <img src="<?php echo WPSC_URL; ?>/images/no_stock.gif" title='No' alt='No' style="margin-top: 4px;"/>
    <?php endif; ?>
    </td>

    <td width="10%">
    <span id="product_price_<?php echo wpsc_the_product_id(); ?>" class="pricedisplay"><?php echo wpsc_the_product_price(); ?></span>
    </td>

    <td width="60%">
    <?php if(wpsc_product_external_link(wpsc_the_product_id()) != '') : ?>
    <?php $action = wpsc_product_external_link(wpsc_the_product_id()); ?>
    <?php else: ?>
    <?php $action = wpsc_this_page_url(); ?>
    <?php endif; ?>
    <form class='product_form' enctype="multipart/form-data" action="<?php echo $action; ?>" method="post" name="product_<?php echo wpsc_the_product_id(); ?>">

    <?php /** the variation group HTML and loop */?>
    <div class="wpsc_variation_forms">
    <?php while (wpsc_have_variation_groups()) : wpsc_the_variation_group(); ?>
    <p>
    <label for="<?php echo wpsc_vargrp_form_id(); ?>"><?php echo wpsc_the_vargrp_name(); ?>:</label>
    <?php /** the variation HTML and loop */?>
    <select class='wpsc_select_variation' name="variation[<?php echo wpsc_vargrp_id(); ?>]" id="<?php echo wpsc_vargrp_form_id(); ?>">
    <?php while (wpsc_have_variations()) : wpsc_the_variation(); ?>
    <option value="<?php echo wpsc_the_variation_id(); ?>"><?php echo wpsc_the_variation_name(); ?></option>
    <?php endwhile; ?>
    </select>
    </p>
    <?php endwhile; ?>
    </div>
    <?php /** the variation group HTML and loop ends here */?>





    <?php if(wpsc_has_multi_adding()): ?>
    <label class='wpsc_quantity_update' for='wpsc_quantity_update[<?php echo wpsc_the_product_id(); ?>]'><?php echo __('Quantity', 'wpsc'); ?>:</label>
    <input type="text" id='wpsc_quantity_update' name="wpsc_quantity_update[<?php echo wpsc_the_product_id(); ?>]" size="2" value="1"/>
    <input type="hidden" name="key" value="<?php echo wpsc_the_cart_item_key(); ?>"/>
    <input type="hidden" name="wpsc_update_quantity" value="true"/>
    <?php endif ;?>

    <input type="hidden" value="add_to_cart" name="wpsc_ajax_action"/>
    <input type="hidden" value="<?php echo wpsc_the_product_id(); ?>" name="product_id"/>


    <?php if((get_option('hide_addtocart_button') == 0) && (get_option('addtocart_or_buynow') !='1')) : ?>
    <?php if(wpsc_product_has_stock()) : ?>
    <div class='wpsc_buy_button_container'>
    <?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="submit" value="<?php echo __('Add To Cart', 'wpsc'); ?>" name="Buy" class="wpsc_buy_button" id="product_<?php echo wpsc_the_product_id(); ?>_submit_button"/>
    <?php endif; ?>
    <div class='wpsc_loading_animation'>
    <img title="Loading" alt="Loading" src="<?php echo WPSC_URL; ?>/images/indicator.gif" class="loadingimage"/>
    <?php echo __('Updating cart...', 'wpsc'); ?>
    </div>
    </div>
    <?php else : ?>
    <p class='soldout'><?php echo __('This product has sold out.', 'wpsc'); ?></p>
    <?php endif ; ?>
    <?php endif ; ?>

    </form>
    </td>
    </tr>

    <tr class="list_view_description">
    <td colspan="5">
    <div id="list_description_<?php echo wpsc_the_product_id(); ?>">
    <?php echo wpsc_the_product_description(); ?>
    </div>
    </td>
    </tr>

    <?php endwhile; ?>
    <?php /** end the product loop here */?>
    </table>


    <?php if(wpsc_product_count() < 1):?>
    <p><?php echo __('There are no products in this group.', 'wpsc'); ?></p>
    <?php endif ; ?>

    <?php

    if(function_exists('fancy_notifications')) {
    echo fancy_notifications();
    }
    ?>


    <!-- Start Pagination -->
    <?php if ( ( get_option( 'use_pagination' ) == 1 && ( get_option( 'wpsc_page_number_position' ) == 2 || get_option( 'wpsc_page_number_position' ) == 3 ) ) ) : ?>
    <div class="wpsc_page_numbers">
    <?php if ( wpsc_has_pages() ) : ?>
    Pages: <?php echo wpsc_first_products_link( '&laquo; First', true ); ?> <?php echo wpsc_previous_products_link( '&laquo; Previous', true ); ?> <?php echo wpsc_pagination( 10 ); ?> <?php echo wpsc_next_products_link( 'Next &raquo;', true ); ?> <?php echo wpsc_last_products_link( 'Last &raquo;', true ); ?>
    <?php endif; ?>
    </div>
    <?php endif; ?>
    <!-- End Pagination -->


    <?php endif; ?>
    </div>


    Thanks

  • #2
    Regular Coder ahayzen's Avatar
    Join Date
    Jun 2009
    Posts
    110
    Thanks
    8
    Thanked 11 Times in 11 Posts
    The <input value="Add To Cart" name="Buy" class="wpsc_buy_button" id="product_1_submit_button" type="submit"> is on a separate div. Try putting it inside the same div.

    Also you could contain all the items you want to go on one line with
    Code:
    <p>put your addcart, title, the cost and quantity here</p>
    This would force them to go onto one line.

    Also looking at your code you open and close the php tags loads. To simplify this you can change the code to this:

    PHP Code:
    <?php
    global $wpsc_query$wpdb;
    echo 
    '<div id="products_page_container" class="wrap wpsc_container">';
    ...
    You will just need to use alternate quotes in your html to php or put slashes before the quote if they are the same as the php echo quotes (such as below).

    PHP Code:
    <?php
    global $wpsc_query$wpdb;
    echo 
    '<div id=\'products_page_container\' class=\'wrap wpsc_container\'>';
    ...
    Andy

  • #3
    New Coder
    Join Date
    Jan 2010
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks for the reply mate but to be honist i dont have a clue what you just said. its just a plugin for wordpress i need to modify. thanks again but could you explain into more detail please

  • #4
    Regular Coder ahayzen's Avatar
    Join Date
    Jun 2009
    Posts
    110
    Thanks
    8
    Thanked 11 Times in 11 Posts
    oh i see ...

    This is the section that needs sorting ...
    PHP Code:
    <?php if(wpsc_has_multi_adding()): ?>
    <label class='wpsc_quantity_update' for='wpsc_quantity_update[<?php echo wpsc_the_product_id(); ?>]'><?php echo __('Quantity''wpsc'); ?>:</label>
    <input type="text" id='wpsc_quantity_update' name="wpsc_quantity_update[<?php echo wpsc_the_product_id(); ?>]" size="2" value="1"/>
    <input type="hidden" name="key" value="<?php echo wpsc_the_cart_item_key(); ?>"/>
    <input type="hidden" name="wpsc_update_quantity" value="true"/>
    <?php endif ;?>

    <input type="hidden" value="add_to_cart" name="wpsc_ajax_action"/>
    <input type="hidden" value="<?php echo wpsc_the_product_id(); ?>" name="product_id"/>


    <?php if((get_option('hide_addtocart_button') == 0) && (get_option('addtocart_or_buynow') !='1')) : ?>
    <?php 
    if(wpsc_product_has_stock()) : ?>
    <div class='wpsc_buy_button_container'>
    <?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="submit" value="<?php echo __('Add To Cart''wpsc'); ?>" name="Buy" class="wpsc_buy_button" id="product_<?php echo wpsc_the_product_id(); ?>_submit_button"/>
    <?php endif; ?>
    <div class='wpsc_loading_animation'>
    <img title="Loading" alt="Loading" src="<?php echo WPSC_URL?>/images/indicator.gif" class="loadingimage"/>
    <?php echo __('Updating cart...''wpsc'); ?>
    </div>
    </div>
    <?php else : ?>
    <p class='soldout'><?php echo __('This product has sold out.''wpsc'); ?></p>
    <?php endif ; ?>
    <?php 
    endif ; ?>
    Find that section and replace it with this. Make sure you dump a backup into notepad just in case it doesn't!

    PHP Code:
    <?php if(wpsc_has_multi_adding()): ?>
    <p>
    <label class='wpsc_quantity_update' for='wpsc_quantity_update[<?php echo wpsc_the_product_id(); ?>]'><?php echo __('Quantity''wpsc'); ?>:</label>
    <input type="text" id='wpsc_quantity_update' name="wpsc_quantity_update[<?php echo wpsc_the_product_id(); ?>]" size="2" value="1"/>
    <input type="hidden" name="key" value="<?php echo wpsc_the_cart_item_key(); ?>"/>
    <input type="hidden" name="wpsc_update_quantity" value="true"/>
    <?php endif ;?>

    <input type="hidden" value="add_to_cart" name="wpsc_ajax_action"/>
    <input type="hidden" value="<?php echo wpsc_the_product_id(); ?>" name="product_id"/>


    <?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="submit" value="<?php echo __('Add To Cart''wpsc'); ?>" name="Buy" class="wpsc_buy_button" id="product_<?php echo wpsc_the_product_id(); ?>_submit_button"/>
    <?php endif; ?>
    <div class='wpsc_loading_animation'>
    <img title="Loading" alt="Loading" src="<?php echo WPSC_URL?>/images/indicator.gif" class="loadingimage"/>
    <?php echo __('Updating cart...''wpsc'); ?>
    </p>
    </div>
    <?php else : ?>
    <p class='soldout'><?php echo __('This product has sold out.''wpsc'); ?></p>
    <?php endif ; ?>
    <?php 
    endif ; ?>
    it may work i'm not sure though cause it is difficult to see.

    Andy

  • #5
    Regular Coder ahayzen's Avatar
    Join Date
    Jun 2009
    Posts
    110
    Thanks
    8
    Thanked 11 Times in 11 Posts
    oh hang on

  • #6
    Regular Coder ahayzen's Avatar
    Join Date
    Jun 2009
    Posts
    110
    Thanks
    8
    Thanked 11 Times in 11 Posts
    PHP Code:
    <?php if(wpsc_has_multi_adding()): ?>
    <p>
    <label class='wpsc_quantity_update' for='wpsc_quantity_update[<?php echo wpsc_the_product_id(); ?>]'><?php echo __('Quantity''wpsc'); ?>:</label>
    <input type="text" id='wpsc_quantity_update' name="wpsc_quantity_update[<?php echo wpsc_the_product_id(); ?>]" size="2" value="1"/>
    <input type="hidden" name="key" value="<?php echo wpsc_the_cart_item_key(); ?>"/>
    <input type="hidden" name="wpsc_update_quantity" value="true"/>
    <?php endif ;?>

    <input type="hidden" value="add_to_cart" name="wpsc_ajax_action"/>
    <input type="hidden" value="<?php echo wpsc_the_product_id(); ?>" name="product_id"/>


    <?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="submit" value="<?php echo __('Add To Cart''wpsc'); ?>" name="Buy" class="wpsc_buy_button" id="product_<?php echo wpsc_the_product_id(); ?>_submit_button"/>
    </p>
    <?php endif; ?>
    <div class='wpsc_loading_animation'>
    <img title="Loading" alt="Loading" src="<?php echo WPSC_URL?>/images/indicator.gif" class="loadingimage"/>
    <?php echo __('Updating cart...''wpsc'); ?>
    </div>
    <?php else : ?>
    <p class='soldout'><?php echo __('This product has sold out.''wpsc'); ?></p>
    <?php endif ; ?>
    <?php 
    endif ; ?>
    Try that.

    Andy

  • #7
    New Coder
    Join Date
    Jan 2010
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    quality mate it has fixed it but the add to cart is before the quantity? and there kind of out of line? thanks so much for what you have do so far tho!

  • #8
    Regular Coder ahayzen's Avatar
    Join Date
    Jun 2009
    Posts
    110
    Thanks
    8
    Thanked 11 Times in 11 Posts
    Ok this should fix the ordering:

    PHP Code:
    <?php if(wpsc_has_multi_adding()): ?>
    <p>
    <label class='wpsc_quantity_update' for='wpsc_quantity_update[<?php echo wpsc_the_product_id(); ?>]'><?php echo __('Quantity''wpsc'); ?>:</label>
    <input type="text" id='wpsc_quantity_update' name="wpsc_quantity_update[<?php echo wpsc_the_product_id(); ?>]" size="2" value="1"/>
    <input type="hidden" name="key" value="<?php echo wpsc_the_cart_item_key(); ?>"/>
    <input type="hidden" name="wpsc_update_quantity" value="true"/>
    <?php endif ;?>

    <input type="hidden" value="add_to_cart" name="wpsc_ajax_action"/>
    <input type="hidden" value="<?php echo wpsc_the_product_id(); ?>" name="product_id"/>


    <?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="submit" value="<?php echo __('Add To Cart''wpsc'); ?>" name="Buy" class="wpsc_buy_button" id="product_<?php echo wpsc_the_product_id(); ?>_submit_button" style="float:right;" />
    </p>
    <?php endif; ?>
    <div class='wpsc_loading_animation'>
    <img title="Loading" alt="Loading" src="<?php echo WPSC_URL?>/images/indicator.gif" class="loadingimage"/>
    <?php echo __('Updating cart...''wpsc'); ?>
    </div>
    <?php else : ?>
    <p class='soldout'><?php echo __('This product has sold out.''wpsc'); ?></p>
    <?php endif ; ?>
    <?php 
    endif ; ?>
    Andy

  • #9
    New Coder
    Join Date
    Jan 2010
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    cheers mate you the man!!! is there anywhere i can get it a bit neater? sorry to be a pest mate. its just the add to cart is over the other side and the add to cart and quantity and not as high as the other two. Cheers

  • #10
    Regular Coder ahayzen's Avatar
    Join Date
    Jun 2009
    Posts
    110
    Thanks
    8
    Thanked 11 Times in 11 Posts
    To sort out the lines change this:
    PHP Code:
    <td width="30%">
    <a class="wpsc_product_title" href="<?php echo wpsc_the_product_permalink(); ?>">
    <strong><?php echo wpsc_the_product_title(); ?></strong>
    </a>
    </td>

    <td width="10" style="text-align: center;">
    <?php if(wpsc_product_has_stock()) : ?>
    <img src="<?php echo WPSC_URL?>/images/yes_stock.gif" alt="Yes" title="Yes" style="margin-top: 4px;"/>
    <?php else: ?>
    <img src="<?php echo WPSC_URL?>/images/no_stock.gif" title='No' alt='No' style="margin-top: 4px;"/>
    <?php endif; ?>
    </td>

    <td width="10%">
    <span id="product_price_<?php echo wpsc_the_product_id(); ?>" class="pricedisplay"><?php echo wpsc_the_product_price(); ?></span>
    </td>

    <td width="60%">
    <?php if(wpsc_product_external_link(wpsc_the_product_id()) != '') : ?>
    <?php $action 
    wpsc_product_external_link(wpsc_the_product_id()); ?>
    <?php 
    else: ?>
    <?php $action 
    wpsc_this_page_url(); ?>
    <?php 
    endif; ?>
    <form class='product_form' enctype="multipart/form-data" action="<?php echo $action?>" method="post" name="product_<?php echo wpsc_the_product_id(); ?>">

    <?php /** the variation group HTML and loop */?>
    <div class="wpsc_variation_forms">
    <?php while (wpsc_have_variation_groups()) : wpsc_the_variation_group(); ?>
    <p>
    <label for="<?php echo wpsc_vargrp_form_id(); ?>"><?php echo wpsc_the_vargrp_name(); ?>:</label>
    <?php /** the variation HTML and loop */?>
    <select class='wpsc_select_variation' name="variation[<?php echo wpsc_vargrp_id(); ?>]" id="<?php echo wpsc_vargrp_form_id(); ?>">
    <?php while (wpsc_have_variations()) : wpsc_the_variation(); ?>
    <option value="<?php echo wpsc_the_variation_id(); ?>"><?php echo wpsc_the_variation_name(); ?></option>
    <?php endwhile; ?>
    </select>
    </p>
    <?php endwhile; ?>
    </div>
    <?php /** the variation group HTML and loop ends here */?>
    to this:

    PHP Code:
    <td width="30%">
    <p><a class="wpsc_product_title" href="<?php echo wpsc_the_product_permalink(); ?>">
    <strong><?php echo wpsc_the_product_title(); ?></strong>
    </a></p>
    </td>

    <td width="10" style="text-align: center;">
    <?php if(wpsc_product_has_stock()) : ?>
    <img src="<?php echo WPSC_URL?>/images/yes_stock.gif" alt="Yes" title="Yes" style="margin-top: 4px;"/>
    <?php else: ?>
    <img src="<?php echo WPSC_URL?>/images/no_stock.gif" title='No' alt='No' style="margin-top: 4px;"/>
    <?php endif; ?>
    </td>

    <td width="10%">
    <p><span id="product_price_<?php echo wpsc_the_product_id(); ?>" class="pricedisplay"><?php echo wpsc_the_product_price(); ?></span></p>
    </td>

    <td width="60%">
    <?php if(wpsc_product_external_link(wpsc_the_product_id()) != '') : ?>
    <?php $action 
    wpsc_product_external_link(wpsc_the_product_id()); ?>
    <?php 
    else: ?>
    <?php $action 
    wpsc_this_page_url(); ?>
    <?php 
    endif; ?>
    <form class='product_form' enctype="multipart/form-data" action="<?php echo $action?>" method="post" name="product_<?php echo wpsc_the_product_id(); ?>">

    <?php /** the variation group HTML and loop */?>
    <div class="wpsc_variation_forms">
    <?php while (wpsc_have_variation_groups()) : wpsc_the_variation_group(); ?>
    <p>
    <label for="<?php echo wpsc_vargrp_form_id(); ?>"><?php echo wpsc_the_vargrp_name(); ?>:</label>
    <?php /** the variation HTML and loop */?>
    <select class='wpsc_select_variation' name="variation[<?php echo wpsc_vargrp_id(); ?>]" id="<?php echo wpsc_vargrp_form_id(); ?>">
    <?php while (wpsc_have_variations()) : wpsc_the_variation(); ?>
    <option value="<?php echo wpsc_the_variation_id(); ?>"><?php echo wpsc_the_variation_name(); ?></option>
    <?php endwhile; ?>
    </select>
    </p>
    <?php endwhile; ?>
    </div>
    <?php /** the variation group HTML and loop ends here */?>
    Andy

  • #11
    Regular Coder ahayzen's Avatar
    Join Date
    Jun 2009
    Posts
    110
    Thanks
    8
    Thanked 11 Times in 11 Posts
    To sort out the add to cart button try this:

    Change this:
    PHP Code:
    <?php if(wpsc_has_multi_adding()): ?>
    <p>
    <label class='wpsc_quantity_update' for='wpsc_quantity_update[<?php echo wpsc_the_product_id(); ?>]'><?php echo __('Quantity''wpsc'); ?>:</label>
    <input type="text" id='wpsc_quantity_update' name="wpsc_quantity_update[<?php echo wpsc_the_product_id(); ?>]" size="2" value="1"/>
    <input type="hidden" name="key" value="<?php echo wpsc_the_cart_item_key(); ?>"/>
    <input type="hidden" name="wpsc_update_quantity" value="true"/>
    <?php endif ;?>

    <input type="hidden" value="add_to_cart" name="wpsc_ajax_action"/>
    <input type="hidden" value="<?php echo wpsc_the_product_id(); ?>" name="product_id"/>


    <?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="submit" value="<?php echo __('Add To Cart''wpsc'); ?>" name="Buy" class="wpsc_buy_button" id="product_<?php echo wpsc_the_product_id(); ?>_submit_button" style="float:right;" />
    </p>
    <?php endif; ?>
    <div class='wpsc_loading_animation'>
    <img title="Loading" alt="Loading" src="<?php echo WPSC_URL?>/images/indicator.gif" class="loadingimage"/>
    <?php echo __('Updating cart...''wpsc'); ?>
    </div>
    <?php else : ?>
    <p class='soldout'><?php echo __('This product has sold out.''wpsc'); ?></p>
    <?php endif ; ?>
    <?php 
    endif ; ?>
    To this:

    PHP Code:
    <?php if(wpsc_has_multi_adding()): ?>
    <p>
    <label class='wpsc_quantity_update' for='wpsc_quantity_update[<?php echo wpsc_the_product_id(); ?>]'><?php echo __('Quantity''wpsc'); ?>:</label>
    <input type="text" id='wpsc_quantity_update' name="wpsc_quantity_update[<?php echo wpsc_the_product_id(); ?>]" size="2" value="1"/>
    <input type="hidden" name="key" value="<?php echo wpsc_the_cart_item_key(); ?>"/>
    <input type="hidden" name="wpsc_update_quantity" value="true"/>
    <?php endif ;?>

    <input type="hidden" value="add_to_cart" name="wpsc_ajax_action"/>
    <input type="hidden" value="<?php echo wpsc_the_product_id(); ?>" name="product_id"/>


    <?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="submit" value="<?php echo __('Add To Cart''wpsc'); ?>" name="Buy" id="product_<?php echo wpsc_the_product_id(); ?>_submit_button" />
    </p>
    <?php endif; ?>
    <div class='wpsc_loading_animation'>
    <img title="Loading" alt="Loading" src="<?php echo WPSC_URL?>/images/indicator.gif" class="loadingimage"/>
    <?php echo __('Updating cart...''wpsc'); ?>
    </div>
    <?php else : ?>
    <p class='soldout'><?php echo __('This product has sold out.''wpsc'); ?></p>
    <?php endif ; ?>
    <?php 
    endif ; ?>
    Andy

  • #12
    New Coder
    Join Date
    Jan 2010
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thats wicked cheers mate, its still out of line a tad but that will do i spose. thanks again mate

  • #13
    Regular Coder ahayzen's Avatar
    Join Date
    Jun 2009
    Posts
    110
    Thanks
    8
    Thanked 11 Times in 11 Posts
    Have u tried the Add cart button fix above?

  • #14
    New Coder
    Join Date
    Jan 2010
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    yeah they have aligned a bit better but its still just a tad out

  • #15
    Regular Coder ahayzen's Avatar
    Join Date
    Jun 2009
    Posts
    110
    Thanks
    8
    Thanked 11 Times in 11 Posts
    Swap this
    (this fixes the add cart going all the way over on the right)
    PHP Code:
    <?php if(wpsc_has_multi_adding()): ?>
    <p>
    <label class='wpsc_quantity_update' for='wpsc_quantity_update[<?php echo wpsc_the_product_id(); ?>]'><?php echo __('Quantity''wpsc'); ?>:</label>
    <input type="text" id='wpsc_quantity_update' name="wpsc_quantity_update[<?php echo wpsc_the_product_id(); ?>]" size="2" value="1"/>
    <input type="hidden" name="key" value="<?php echo wpsc_the_cart_item_key(); ?>"/>
    <input type="hidden" name="wpsc_update_quantity" value="true"/>
    <?php endif ;?>

    <input type="hidden" value="add_to_cart" name="wpsc_ajax_action"/>
    <input type="hidden" value="<?php echo wpsc_the_product_id(); ?>" name="product_id"/>


    <?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="submit" value="<?php echo __('Add To Cart''wpsc'); ?>" name="Buy" class="wpsc_buy_button" id="product_<?php echo wpsc_the_product_id(); ?>_submit_button" style="float:right;" />
    </p>
    <?php endif; ?>
    <div class='wpsc_loading_animation'>
    <img title="Loading" alt="Loading" src="<?php echo WPSC_URL?>/images/indicator.gif" class="loadingimage"/>
    <?php echo __('Updating cart...''wpsc'); ?>
    </div>
    <?php else : ?>
    <p class='soldout'><?php echo __('This product has sold out.''wpsc'); ?></p>
    <?php endif ; ?>
    <?php 
    endif ; ?>
    For this

    PHP Code:
    <?php if(wpsc_has_multi_adding()): ?>
    <p>
    <label class='wpsc_quantity_update' for='wpsc_quantity_update[<?php echo wpsc_the_product_id(); ?>]'><?php echo __('Quantity''wpsc'); ?>:</label>
    <input type="text" id='wpsc_quantity_update' name="wpsc_quantity_update[<?php echo wpsc_the_product_id(); ?>]" size="2" value="1"/>
    <input type="hidden" name="key" value="<?php echo wpsc_the_cart_item_key(); ?>"/>
    <input type="hidden" name="wpsc_update_quantity" value="true"/>
    <?php endif ;?>

    <input type="hidden" value="add_to_cart" name="wpsc_ajax_action"/>
    <input type="hidden" value="<?php echo wpsc_the_product_id(); ?>" name="product_id"/>


    <?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="submit" value="<?php echo __('Add To Cart''wpsc'); ?>" name="Buy" id="product_<?php echo wpsc_the_product_id(); ?>_submit_button" />
    </p>
    <?php endif; ?>
    <div class='wpsc_loading_animation'>
    <img title="Loading" alt="Loading" src="<?php echo WPSC_URL?>/images/indicator.gif" class="loadingimage"/>
    <?php echo __('Updating cart...''wpsc'); ?>
    </div>
    <?php else : ?>
    <p class='soldout'><?php echo __('This product has sold out.''wpsc'); ?></p>
    <?php endif ; ?>
    <?php 
    endif ; ?>
    Also to align the text slightly better swap this:

    PHP Code:
    <td width="30%">
    <p><a class="wpsc_product_title" href="<?php echo wpsc_the_product_permalink(); ?>">
    <strong><?php echo wpsc_the_product_title(); ?></strong>
    </a></p>
    </td>

    <td width="10" style="text-align: center;">
    <?php if(wpsc_product_has_stock()) : ?>
    <img src="<?php echo WPSC_URL?>/images/yes_stock.gif" alt="Yes" title="Yes" style="margin-top: 4px;"/>
    <?php else: ?>
    <img src="<?php echo WPSC_URL?>/images/no_stock.gif" title='No' alt='No' style="margin-top: 4px;"/>
    <?php endif; ?>
    </td>

    <td width="10%">
    <p><span id="product_price_<?php echo wpsc_the_product_id(); ?>" class="pricedisplay"><?php echo wpsc_the_product_price(); ?></span></p>
    </td>

    <td width="60%">
    <?php if(wpsc_product_external_link(wpsc_the_product_id()) != '') : ?>
    <?php $action 
    wpsc_product_external_link(wpsc_the_product_id()); ?>
    <?php 
    else: ?>
    <?php $action 
    wpsc_this_page_url(); ?>
    <?php 
    endif; ?>
    <form class='product_form' enctype="multipart/form-data" action="<?php echo $action?>" method="post" name="product_<?php echo wpsc_the_product_id(); ?>">

    <?php /** the variation group HTML and loop */?>
    <div class="wpsc_variation_forms">
    <?php while (wpsc_have_variation_groups()) : wpsc_the_variation_group(); ?>
    <p>
    <label for="<?php echo wpsc_vargrp_form_id(); ?>"><?php echo wpsc_the_vargrp_name(); ?>:</label>
    <?php /** the variation HTML and loop */?>
    <select class='wpsc_select_variation' name="variation[<?php echo wpsc_vargrp_id(); ?>]" id="<?php echo wpsc_vargrp_form_id(); ?>">
    <?php while (wpsc_have_variations()) : wpsc_the_variation(); ?>
    <option value="<?php echo wpsc_the_variation_id(); ?>"><?php echo wpsc_the_variation_name(); ?></option>
    <?php endwhile; ?>
    </select>
    </p>
    <?php endwhile; ?>
    </div>
    <?php /** the variation group HTML and loop ends here */?>
    For this:

    PHP Code:
    <td width="30%">
    <p style="padding-top: 7px;"><a class="wpsc_product_title" href="<?php echo wpsc_the_product_permalink(); ?>">
    <strong><?php echo wpsc_the_product_title(); ?></strong>
    </a></p>
    </td>

    <td width="10" style="text-align: center;">
    <?php if(wpsc_product_has_stock()) : ?>
    <p style="padding-top: 7px;"><img src="<?php echo WPSC_URL?>/images/yes_stock.gif" alt="Yes" title="Yes" style="margin-top: 4px;"/></p>
    <?php else: ?>
    <p style="padding-top: 7px;"><img src="<?php echo WPSC_URL?>/images/no_stock.gif" title='No' alt='No' style="margin-top: 4px;"/></p>
    <?php endif; ?>
    </td>

    <td width="10%">
    <p style="padding-top: 7px;"><span id="product_price_<?php echo wpsc_the_product_id(); ?>" class="pricedisplay"><?php echo wpsc_the_product_price(); ?></span></p>
    </td>

    <td width="60%">
    <?php if(wpsc_product_external_link(wpsc_the_product_id()) != '') : ?>
    <?php $action 
    wpsc_product_external_link(wpsc_the_product_id()); ?>
    <?php 
    else: ?>
    <?php $action 
    wpsc_this_page_url(); ?>
    <?php 
    endif; ?>
    <form class='product_form' enctype="multipart/form-data" action="<?php echo $action?>" method="post" name="product_<?php echo wpsc_the_product_id(); ?>">

    <?php /** the variation group HTML and loop */?>
    <div class="wpsc_variation_forms">
    <?php while (wpsc_have_variation_groups()) : wpsc_the_variation_group(); ?>
    <p>
    <label for="<?php echo wpsc_vargrp_form_id(); ?>"><?php echo wpsc_the_vargrp_name(); ?>:</label>
    <?php /** the variation HTML and loop */?>
    <select class='wpsc_select_variation' name="variation[<?php echo wpsc_vargrp_id(); ?>]" id="<?php echo wpsc_vargrp_form_id(); ?>">
    <?php while (wpsc_have_variations()) : wpsc_the_variation(); ?>
    <option value="<?php echo wpsc_the_variation_id(); ?>"><?php echo wpsc_the_variation_name(); ?></option>
    <?php endwhile; ?>
    </select>
    </p>
    <?php endwhile; ?>
    </div>
    <?php /** the variation group HTML and loop ends here */?>
    Andy


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •