Registered an account just to post my little bit.
I managed to get SEO URL's and Buy Now working together by editing one of the files included in seo urls.
Open includes/classes/seo.class.php
Look for the two return $link;
Comment out or replace both with
// AJAX Addto shopping_cart - Begin
$link_ajax = '';
if( tep_not_null($parameters) && preg_match("/buy_now/i", $parameters) && $page != 'ajax_shopping_cart.php'){
$link_ajax = '" onclick="doBuyNowGet(\'' . tep_href_link( 'ajax_shopping_cart.php', $parameters, $connection, $add_session_id, $search_engine_safe) . '\'); return false;';
}
return $link . $link_ajax;
// AJAX Addto shopping_cart - End
Mine looks like the following
switch($this->attributes['SEO_URLS_USE_W3C_VALID']){
case ('true'):
if (!isset($_SESSION['customer_id']) && defined('ENABLE_PAGE_CACHE') && ENABLE_PAGE_CACHE == 'true' && class_exists('page_cache')){
//return $link;
// AJAX Addto shopping_cart - Begin
$link_ajax = '';
if( tep_not_null($parameters) && preg_match("/buy_now/i", $parameters) && $page != 'ajax_shopping_cart.php'){
$link_ajax = '" onclick="doBuyNowGet(\'' . tep_href_link( 'ajax_shopping_cart.php', $parameters, $connection, $add_session_id, $search_engine_safe) . '\'); return false;';
}
return $link . $link_ajax;
// AJAX Addto shopping_cart - End
} else {
return htmlspecialchars(utf8_encode($link));
}
break;
case ('false'):
//return $link;
// AJAX Addto shopping_cart - Begin
$link_ajax = '';
if( tep_not_null($parameters) && preg_match("/buy_now/i", $parameters) && $page != 'ajax_shopping_cart.php'){
$link_ajax = '" onclick="doBuyNowGet(\'' . tep_href_link( 'ajax_shopping_cart.php', $parameters, $connection, $add_session_id, $search_engine_safe) . '\'); return false;';
}
return $link . $link_ajax;
// AJAX Addto shopping_cart - End
break;
}
} # end function
It's probably not optimal or even neccessary to replace both but I have no idea what I'm doing so I thought it best.
Also, adding buy now to the product_listing.php page, I assume I only need once instance of the form to cover the entire table? I know little php but I've done enough programming to mash something together.
echo '<td align="center" valign=bottom width=33%><table align="center" border=0 width=100%><tr><td align="center" valign=top>'.$lc_text.'</td></tr><tr><td align="center" valign="bottom"><br>'.$prod_name.'<br>Price : ' . $lc_text_price.'<br>' . tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')) .tep_draw_hidden_field('products_id', $listing['products_id']) . tep_image_submit('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW).'</form><br><br></td></tr></table></td>';
Is what I have currently, obviously I'm drawing a new form for each buy now part, to me it looks like I can remove the form and only have one covering the table?
Website is here Crystal Planet for an example.
Hope this helps some of you!