Jump to content

wmguk

Members
  • Posts

    618
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

wmguk's Achievements

Advanced Member

Advanced Member (4/5)

0

Reputation

  1. Hey Guys, I'm hand coding a display page and I keep getting this error: Parse error: syntax error, unexpected T_ENDWHILE in wpsc-grid_view.php on line 174 I cannot work out whats causing it..... Can anyone help please? <?php global $wp_query; $image_width = get_option('product_image_width'); $image_height = get_option('product_image_height'); ?> <div id="grid_view_products_page_container"> <?php wpsc_output_breadcrumbs(); ?> <?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 group"> <?php wpsc_start_category_query(array('category_group'=> 1, 'show_thumbnails'=> 1)); ?> <a href="<?php wpsc_print_category_url();?>" class="wpsc_category_grid_item <?php wpsc_print_category_classes_section(); ?>" title="<?php wpsc_print_category_name();?>"> <?php wpsc_print_category_image(45, 45); ?> </a> <?php wpsc_print_subcategory("", ""); ?> <?php wpsc_end_category_query(); ?> </div><!--close wpsc_categories--> <?php else:?> <ul class="wpsc_categories"> <?php wpsc_start_category_query(array('category_group'=> 1, '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_classes_section(); ?>"><?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><!--close wpsc_category_details--> <?php endif; ?> <?php if(wpsc_has_pages_top()) : ?> <div class="wpsc_page_numbers_top group"> <?php wpsc_pagination(); ?> </div><!--close wpsc_page_numbers_top--> <?php endif; ?> <div class="product_grid_display group"> <?php while (wpsc_have_products()) : wpsc_the_product(); ?> <div class="product_grid_item product_view_<?php echo wpsc_the_product_id(); ?>"> <?php if(wpsc_the_product_thumbnail()) :?> <p class="prodtitle"><a href="<?php echo wpsc_the_product_permalink(); ?>" title="<?php echo wpsc_the_product_title(); ?>"><?php echo wpsc_the_product_title(); ?></a></p> <?php if(wpsc_the_product_thumbnail()) :?> <div class="item_image"> <a href="<?php echo wpsc_the_product_permalink(); ?>"> <img style="width:<?php echo get_option('product_image_width'); ?>px;height:<?php echo get_option('product_image_height'); ?>px" class="product_image" id="product_image_<?php echo wpsc_the_product_id(); ?>" alt="<?php echo wpsc_the_product_title(); ?>" src="<?php echo wpsc_the_product_thumbnail(); ?>" /> </a> </div><!--close imte_image--> <?php else: ?> <div class="item_no_image"> <a href="<?php echo wpsc_the_product_permalink(); ?>"> <img class="no-image" id="product_image_<?php echo wpsc_the_product_id(); ?>" alt="No Image" title="<?php echo wpsc_the_product_title(); ?>" src="<?php echo WPSC_CORE_THEME_URL; ?>wpsc-images/noimage.png" width="<?php echo get_option('product_image_width'); ?>" height="<?php echo get_option('product_image_height'); ?>" /> </a> </div><!--close item_no_image--> <?php endif; ?> <?php if (wpsc_category_name() == Sold ): ?> <a href="http://craftsbysteve.com/enquiry.php?prod_id=<?php echo wpsc_the_product_title(); ?>" title="Make enquiry about <?php echo wpsc_the_product_title(); ?>" alt="Make enquiry about <?php echo wpsc_the_product_title(); ?>" target="_blank"><img src="http://craftsbysteve.com/wp-content/uploads/2012/07/enquire.png"></a> <?php elseif (wpsc_category_name() != Sold ): ?> <?php if(wpsc_product_on_special()) : ?><span class="sale"><?php _e('Sale', 'wpsc'); ?></span><?php endif; ?> <?php if(get_option('show_images_only') != 1): ?> <div class="grid_product_info"> <?php if((wpsc_the_product_description() != '') && (get_option('display_description') == 1)): ?> <div class="grid_description"><?php echo wpsc_the_product_description(); ?></div> <?php endif; ?> <div class="price_container"> <?php if(wpsc_product_on_special()) : ?> <p class="pricedisplay <?php echo wpsc_the_product_id(); ?>"><?php _e('Old Price', 'wpsc'); ?>:<span class="oldprice"><?php echo wpsc_product_normal_price(); ?></span></p> <?php endif; ?> <p class="pricedisplay <?php echo wpsc_the_product_id(); ?>"><span id='product_price_<?php echo wpsc_the_product_id(); ?>' class="currentprice pricedisplay"><?php echo wpsc_the_product_price(); ?></span></p> <?php if(wpsc_show_pnp()) : ?> <p class="pricedisplay"><?php _e('Delivery', 'wpsc'); ?>:<span class="pp_price"><?php echo wpsc_product_postage_and_packaging(); ?></span></p> <?php endif; ?> </div><!--close price_container--> </div><!--close grid_product_info--> <div class="grid_more_info"> <?php if(get_option('display_moredetails') == 1) : ?> <div style="float: right; margin-top: -28px; width: 95px;"><a href="<?php echo wpsc_the_product_permalink(); ?>" class="more_details">More Details</a></div> <?php endif; ?> <div style="float: right; margin-top: -6px; width: 95px;"> <form class="product_form" enctype="multipart/form-data" action="<?php echo wpsc_this_page_url(); ?>" method="post" name="product_<?php echo wpsc_the_product_id(); ?>" id="product_<?php echo wpsc_the_product_id(); ?>" > <?php do_action ( 'wpsc_product_form_fields_begin' ); ?> <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('display_variations') == 1) : ?> <?php /** the variation group HTML and loop */ ?> <?php if (wpsc_have_variation_groups()) : ?> <fieldset><legend><?php _e('Product Options', 'wpsc'); ?></legend> <div class="wpsc_variation_forms"> <table> <?php while (wpsc_have_variation_groups()) : wpsc_the_variation_group(); ?> <tr><td class="col1"><label for="<?php echo wpsc_vargrp_form_id(); ?>"><?php echo wpsc_the_vargrp_name(); ?>:</label></td> <?php /** the variation HTML and loop */?> <td class="col2"><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_out_of_stock(); ?>><?php echo wpsc_the_variation_name(); ?></option> <?php endwhile; ?> </select></td></tr> <?php endwhile; ?> </table> </div><!--close wpsc_variation_forms--> </fieldset> <?php /** the variation group HTML and loop ends here */?> <?php endif; ?> <?php endif ?> <?php if((get_option('display_addtocart') == 1) && (get_option('addtocart_or_buynow') !='1')) :?> <?php if(wpsc_product_has_stock()) : ?> <input type="submit" value="<?php _e('Add To Basket', 'wpsc'); ?>" name="Buy" class="wpsc_buy_button" id="product_<?php echo wpsc_the_product_id(); ?>_submit_button"/> <?php else : ?> <p class="soldout"><?php _e('Sorry, sold out!', 'wpsc'); ?></p> <?php endif ; ?> <?php endif; ?> <div class="wpsc_loading_animation"> <img title="Loading" alt="Loading" src="<?php echo wpsc_loading_animation_url(); ?>" /> <?php _e('Updating Basket...', 'wpsc'); ?> </div><!--close wpsc_loading_animation--> <?php do_action ( 'wpsc_product_form_fields_end' ); ?> </form></div> </div><?php endif; ?> <!--close grid_more_info--> <?php if((get_option('display_addtocart') == 1) && (get_option('addtocart_or_buynow') == '1')) :?> <?php echo wpsc_buy_now_button(wpsc_the_product_id()); ?> <?php endif ; ?> <?php endif; ?> </div><!--close product_grid_item--> <?php if((get_option('grid_number_per_row') > 0) && ((($wp_query->current_post +1) % get_option('grid_number_per_row')) == 0)) :?> <div class="grid_view_clearboth"></div> <?php endif ; ?> <?php endwhile; ?> <?php if(wpsc_product_count() == 0):?> <p><?php _e('There are no products in this group.', 'wpsc'); ?></p> <?php endif ; ?> </div><!--close product_grid_display--> <?php if(wpsc_has_pages_bottom()) : ?> <div class="wpsc_page_numbers_bottom group"> <?php wpsc_pagination(); ?> </div><!--close wpsc_page_numbers_bottom--> <?php endif; ?> <?php endif; ?> <?php do_action( 'wpsc_theme_footer' ); ?> </div><!--close grid_view_products_page_container-->
  2. Hey Guys, I'm using wordpress and attempting to pass and image name via php - <?php echo do_shortcode('[popup url="http://domain.com/enquire.php?prod_id=". echo $image->alttext ."]Enquire[/popup]'); ?> Breaks the code - the url becomes domain.com/currentpage not enquire.php <?php echo do_shortcode('[popup url="http://domain.com/enquire.php?prod_id=$image->alttext"]Enquire[/popup]'); ?> the URL shows as http://domain.com/enquire.php?prod_id=$image->alttext I cannot get it to display the actual alttext output... Any ideas how I can pass this info?...
  3. Hey, I have a shopping cart and I'm looking for a way to display two buttons side by side... [More Details] [Add To Basket] The more details link, is just an href and the add to basket is a form submitting data... I have this code currently <div class="productdisplay default_product_display product_view_64 all-categories"> <div class="textcol"> <div class="imagecol"> <a href="http://XXXXXX.co.uk/demo/wp-content/uploads/wpsc/product_images/21003100.jpg" class="thickbox preview_link" rel="ALICE_AND_THE_WHITE_HARE"> <img src="http://XXXXXX.co.uk/demo/wp-content/uploads/wpsc/product_images/thumbnails/21003100.jpg" title="ALICE AND THE WHITE HARE" alt="ALICE AND THE WHITE HARE" id="product_image_64" class="product_image"> </a> </div> <div class="producttext"> <div class="prodtitles"> <a href="http://XXXXX.co.uk/demo/?page_id=36&category=5&product_id=64" class="wpsc_product_title">ALICE AND THE WHITE HARE</a> </div> <form id="product_64" name="product_64" method="post" action="" enctype="multipart/form-data" class="product_form"> <div class="custom_meta"> </div> <div class="wpsc_variation_forms"> </div> <!-- THIS IS THE QUANTITY OPTION MUST BE ENABLED FROM ADMIN SETTINGS --> <p class="wpsc_extras_forms"> </p><div class="wpsc_product_price"> <span class="pricedisplay" id="product_price_64">£39.99</span>Price: <br> </div> <input type="hidden" name="wpsc_ajax_action" value="add_to_cart"> <input type="hidden" name="product_id" value="64"> <!-- END OF QUANTITY OPTION --> <div class="wpsc_buy_button_container"> <span class="art-button-wrapper"><span class="l"> </span><span class="r"> </span><input type="submit" id="product_64_submit_button" class="art-button" name="Buy" value="Add To Basket"></span> <div class="wpsc_loading_animation"> <img class="loadingimage" src="http://XXXXX.co.uk/demo/wp-content/plugins/wp-e-commerce/images/indicator.gif" alt="Loading" title="Loading"> Updating cart... </div> </div> </form> <form action="http://XXXXXX.co.uk/demo/?page_id=36&category=5&product_id=64" method="post"> <span class="art-button-wrapper "><span class="l"> </span><span class="r"> </span><input type="submit" id="product_64_submit_button" class="art-button" name="Details" value="More Details"></span></form> </div> </div> </div> However they come out first form above the second form, and I need the actual buttons to be side by side.... The more details has to be a button because of the style sheet info... but how can I get them side by side?
  4. ah ha, != '' worked! Thank you
  5. Hey, I've got a site and I need to query a database to check if there is a result. If there isnt then I need a default result... //Check the database and get a result $skinName = strtolower(get_post_meta($post_id, $key, $single)); if (isset($skinName)) { //If there is a result, then use it $skinName = strtolower(get_post_meta($post_id, $key, $single)); } else { //If NO result then use RED $skinName = 'red'; } //Build up the var to show REDsite $skinName = $skinName . 'site'; For some reason the above doesnt work. If there is a result then it uses it, however if there is no result then it simply shows "site" - not "redsite" like it should do. Any ideas what I missed?
  6. I don't really understand but I had a quick look and I think the only code I can find in any of the theme php pages that looks anything like it is: function cs_getoption($option) { $msoptions = get_option('msoptions'); $value = replace_holders($msoptions[$option]); if($value != '') return $value; else return get_default_setting($option); } Does this help or am I going in the wrong direction?
  7. Hi, I'm using a wordpress theme on my website and for some reason it is sorting the page names alphabetically instead of by "menu_order" in the DB... all I can find is this function: <?php $pages = cs_getoption('menu-pages'); if(!empty($pages)): foreach($pages as $page) { $page_data = get_page($page); echo '<li><a href="' . get_permalink($page). '">' . ucfirst($page_data->post_name) . '</a></li>'; } endif; ?> Any ideas how I can get this orderby "menu_order"
  8. Hi Guys I've been trying to work on my OS Commerce site, but for some reason I'm getting this error on the main index.php page. Welcome Guest! Would you like to log yourself in? Or would you prefer to create an account? Feel free to click any of the links below to access the main categories. Warning: strpos() [function.strpos]: Empty delimiter. in /var/www/vhosts/XXXXXX.co.uk/httpdocs/shop/index.php on line 319 319 shows this: if (isset($cPath) && strpos('_', $cPath)) { Any ideas where this error comes from?
  9. Hi again I've managed to get some of it working, but the code is a right mess, can you help me out please? <table border="0" cellspacing="0" cellpadding="0" width="162"> <tr> <td class="bg4" width="162" height="30"> <span class="tx2"><?=BOX_HEADING_SHOPPING_CART?></span> </td> </tr> <tr> <td><ul><?php $cart_contents_string = ''; if ($cart->count_contents() > 0) { $cart_contents_string = ''; $products = $cart->get_products(); for ($i=0, $n=sizeof($products); $i<$n; $i++) { $cart_contents_string .= '<span align="right">'; $cart_contents_string .= '<li>' . $products[$i]['quantity'] . ' x <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">' . $products[$i]['name'] . '</span></a></li>'; } } else { $cart_contents_string .= BOX_SHOPPING_CART_EMPTY; } $info_box_contents = array(); $info_box_contents[] = array('text' => $cart_contents_string); if ($cart->count_contents() > 0) { $info_box_contents[] = array('text' => tep_draw_separator()); $info_box_contents[] = array('align' => 'right', 'text' => $currencies->format($cart->show_total())); //cart buttons start $info_box_contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . tep_image_button ('button_view_cart.gif', IMAGE_BUTTON_CART_VIEW) . '</a>' . ' <a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING) . '">' . tep_image_button ('button_checkout1.gif', IMAGE_BUTTON_CART_CHECKOUT) . '</a>' ); //cart buttons end } new infoBox($info_box_contents); ?> <!-- shopping_cart_eof //--></ul></td> </tr> </table>
  10. Ok, Managed to get the code working for the buttons, but struggling with the <li> stuff. Cant see where I need to start the <UL> etc...
  11. Hey, I'm editting some code on an OS Commerce install, For some reason I dont get the various buttons displaying. Underneath the shopping basket, it is supposed to show a view cart button and a checkout button, but they dont show up. I'm also trying to edit it to use a layout of the stylesheet, Basically if you look at my website, you will see the categories list, these are generated by an <ul><li> code, which puts the background underneath the item name, I would like to do the same thing and limit the charactors in the name to say 50 (so they stay on one line) Can you point me in the right direction to set an <li> on each item in the cart, and change it to UCWORDS, and restrict the charactors please? Any ideas on why the images dont show up on the page? http://tinyurl.com/2f6g2lg This is my code. <?php /* $Id: shopping_cart.php,v 1.18 2003/02/10 22:31:06 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ ?> <!-- shopping_cart //--> <?php // $info_box_contents = array(); // $info_box_contents[] = array('text' => BOX_HEADING_SHOPPING_CART); // new infoBoxHeading($info_box_contents, false, true, tep_href_link(FILENAME_SHOPPING_CART)); $cart_contents_string = ''; if ($cart->count_contents() > 0) { $cart_contents_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">'; $products = $cart->get_products(); for ($i=0, $n=sizeof($products); $i<$n; $i++) { $cart_contents_string .= '<tr><td align="right" valign="top" class="infoBoxContents">'; if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) { $cart_contents_string .= '<span class="newItemInCart">'; } else { $cart_contents_string .= '<span class="infoBoxContents">'; } $cart_contents_string .= $products[$i]['quantity'] . ' x </span></td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">'; if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) { $cart_contents_string .= '<span class="newItemInCart">'; } else { $cart_contents_string .= '<span class="infoBoxContents">'; } $cart_contents_string .= $products[$i]['name'] . '</span></a></td></tr>'; if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) { tep_session_unregister('new_products_id_in_cart'); } } $cart_contents_string .= '</table>'; } else { $cart_contents_string .= BOX_SHOPPING_CART_EMPTY; } $info_box_contents = array(); $info_box_contents[] = array('text' => $cart_contents_string); if ($cart->count_contents() > 0) { $info_box_contents[] = array('text' => tep_draw_separator()); $info_box_contents[] = array('align' => 'right', 'text' => $currencies->format($cart->show_total()) ); //cart buttons start $info_box_contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . tep_image_button ('button_cart_view.gif', IMAGE_BUTTON_CART_VIEW) . '</a>' . '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING) . '">' . tep_image_button ('button_cart_checkout.gif', IMAGE_BUTTON_CART_CHECKOUT) . '</a>' ); //cart buttons end } new infoBox($info_box_contents); ?> <!-- shopping_cart_eof //-->
  12. has that made anything clearer?
  13. ok, I am using a CMS system called WolfCMS, and I am trying to make a plugin for it. Basically I have a section of files, some with functions in, and others using those functions... My ultimate goal is to edit a product. - Name, Desc, Price (ID is fixed).... So, I click on <a href="<?php echo get_url('plugin/ecat/edit'.$pid); ?> and it checks my function list for edit() function edit($id) { $this->display('ecat/views/edit'); } so how do i get it to assign $id to the $pid in the url? once the id is assigned, it will edit the code using <h1><?php echo __('Edit Product'); ?></h1> <form action="<?php echo get_url('plugin/ecat/edit_prod' . $product->id); ?>" method="post"> <input name="pid" type="hidden" value="<?php echo $pid; ?>"/> <table width="800" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="200">Product Name:</td> <td><input name="pname" type="text" value="<?php echo $pname; ?>"/></td> </tr> <tr> <td>Product Description</td> <td><input name="pdesc" type="text" value="<?php echo $pdesc; ?>"/></td> </tr> <tr> <td>Product Price:</td> <td><input name="pprice" type="text" value="<?php echo $pprice; ?>"/></td> </tr> <tr> <td> </td> <td><input class="button" name="commit" type="submit" accesskey="s" value="<?php echo __('Save'); ?>" /></td> </tr> </table> </form>[code]
  14. Hi, I'm trying to pass a database variable to a function... <?php global $__CMS_CONN__; $sql = "SELECT * FROM " . TABLE_PREFIX . "products"; $stmt = $__CMS_CONN__->prepare($sql); $stmt->execute(array($id)); while ($row = $stmt->fetchObject()) { $pid = $row->pid; $pname = $row->pname; $pdesc = $row->pdesc; $pprice = $row->pprice; ?> <a href="<?php echo get_url('plugin/ecat/edit'.$pid); ?>"><img src="<?php echo ECAT_ROOT;?>images/product_edit.jpg" align="middle" alt="Edit Product" /></a> However it goes to /plugin/ecat/edit1 or edit2 etc etc. - I'm trying to get it to go to edit and pass $pid to a function function edit($id) { $this->display('ecat/views/edit'); } any ideas?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.