Jump to content
bumbarash

[Contribution] iOSC - mobile version of OSC on your iPhone

Recommended Posts

@@Stephan Gebbers,

 

Did you add the support for your SEO URLs and do the mobile URLs show correct?

 

yep, i have added usu5 support and the mobile urls and redirects look good using the mobile site.

i 've had the same problem with my files for google merchant center to create the mobile urls. 

 

i do it like that now. It's a workaround but it does the job.

So i take the normal usu5 url via tep_href_link and replace the domain.com/ with domain.com/mobile/ and further use the replacement logic as seen in the redirect class. that creates correct mobile product urls for me now.

  // iOSC mobile products urls -- BOF
    $str_replace_from = array('/-p-/', '/-c-/', '/-m-/', '/-pr-/', '/-pri-/', '/-pi-/', '/-a-/', '/-au-/', '/-by-/', '/-f-/', '/-fc-/', '/-fri-/', '/-fra-/', '/-i-/', '/-links-/', '/-n-/', '/-nc-/', '/-nri-/', '/-nra-/', '/-pm-/', '/-po-/', '/-t-/');
    $str_replace_to = array('-mp-', '-mc-', '-mm-', '-mpr-', '-mpri-', '-mpi-', '-ma-', '-mau-', '-mby-', '-mf-', '-mfc-', '-mfri-', '-mfra-', '-mi-', '-mlinks-', '-mn-', '-mnc-', '-mnri-', '-mnra-', '-mpm-', '-mpo-', '-mt-');
$produrl = tep_href_link( FILENAME_PRODUCT_INFO, 'products_id=' . (int)$row['products_id'], 'NONSSL', false );
$produrl_mobile = str_replace('domain.com/','domain.com/mobile/',$produrl);
$produrl_mobile = preg_replace($str_replace_from, $str_replace_to, $produrl_mobile);      
  // iOSC mobile products urls -- EOF

same for the mobile categories urls

  // iOSC mobile category URLs -- BOF
    $str_replace_from = array('/-p-/', '/-c-/', '/-m-/', '/-pr-/', '/-pri-/', '/-pi-/', '/-a-/', '/-au-/', '/-by-/', '/-f-/', '/-fc-/', '/-fri-/', '/-fra-/', '/-i-/', '/-links-/', '/-n-/', '/-nc-/', '/-nri-/', '/-nra-/', '/-pm-/', '/-po-/', '/-t-/');
    $str_replace_to = array('-mp-', '-mc-', '-mm-', '-mpr-', '-mpri-', '-mpi-', '-ma-', '-mau-', '-mby-', '-mf-', '-mfc-', '-mfri-', '-mfra-', '-mi-', '-mlinks-', '-mn-', '-mnc-', '-mnri-', '-mnra-', '-mpm-', '-mpo-', '-mt-');
$caturl = tep_href_link( FILENAME_DEFAULT, 'cPath=' . $detail['path'], 'NONSSL', false );
$caturl_mobile = str_replace('domain.com/','domain.com/mobile/',$caturl);
$caturl_mobile = preg_replace($str_replace_from, $str_replace_to, $caturl_mobile);      
  // iOSC mobile category URLs -- EOF

i'm sure thats not how it's ment to be, but i have it working that way now. As i look at the code now, i guess i could have just added domain.com/ and domain.com/mobile/ in the replacement arrays :)


 

 

Share this post


Link to post
Share on other sites

How could the jquery form_check.js.php (the one in the mobile directory) be modified to check if the street field contains a streetnumber?

 

Regards,

Stephan


 

 

Share this post


Link to post
Share on other sites

Hello Stephan, @@Stephan Gebbers,

 

Here the jquery validation reference site:

https://jqueryvalidation.org/documentation/

 

If you can't realize what you need with the standard rules, I guess you'll need to code a custom validation function.

 

Some thoughts about:

- There a valid street addresses without number, at least in Spain, but maybe in other countries too. (Example: My Street, s/n: means "without number"). It wouldn't be correct to force the customer to fill in a number in that case.

- There exist valid street numbers containing non numeric signs like letters and special characters (A/B/left/right/bis/º/ª...).

   In Spain the following example for street number is common: My Street, 25, esc.B, 2º, 1ª C (this means: Number 25, stair B, floor 2, door 1C)

- There are street address formats which put the number at the beginning or at the end.

- There are street names containing numbers (dates, 7th avenue...)

 

All of this makes it quite complicate to create a validation script for all cases, not sure if it's worth. :-

 

rgds

Rainer

Edited by raiwa

Share this post


Link to post
Share on other sites

Hi,

 

Is there any support to add the "additional images" addon ? I saw that there's support for "More pics" but I have "additional images".

 

Thanks a lot.

Share this post


Link to post
Share on other sites

Hello,

 

I need help for the "additional images" addon please...

 

I tried to integrate it but the code is very complicated, and I need to integrate it with the mobile fancybox, don't I ? 

 

I succeded to show the thumbnails on the product page but then we can't open it.

 

Here is the code of a desktop product_info.php page with the "additional images" addon :


<?php
/*
  $Id: product_info.php 1739 2007-12-20 00:52:16Z hpdl $

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License
*/

  require('includes/application_top.php');

  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO);
 
// BOF: Additional Images
  if (empty($_GET['pID'])) { $_GET['pID'] = $_GET['products_id']; }

if (ADDIMAGES_MENU_LOCATION == 'product_info') {
  include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_POPUP_ADD_IMAGE);

 // $navigation->remove_current_page();

  if (!empty($_GET['imagesID'])) {
    $products_query = tep_db_query( "SELECT ai.products_id, ai.images_description, ai.thumb_images, ai.medium_images, ai.popup_images, p.products_image, p.products_image_med, p.products_image_pop, p.products_image_description FROM " . TABLE_ADDITIONAL_IMAGES . " ai, " . TABLE_PRODUCTS . " p WHERE ai.products_id=p.products_id and ai.additional_images_id = '".(int)$_GET['imagesID']."'");
    $selected_image = tep_db_fetch_array($products_query);
  } elseif (!empty($_GET['pID'])) {
    $products_query = tep_db_query( "SELECT products_id, products_image, products_image_med, products_image_pop, products_image_description FROM " . TABLE_PRODUCTS . " WHERE products_id = '".(int)$_GET['pID']."'");
    $selected_image = tep_db_fetch_array($products_query);
  }

  $imagemenu = new displayonpageimagemenu ( $selected_image['products_id'] );

  // calculate menu size in pixels
  $extra_window_width = 24;  // space for web browser
  $extra_window_height = 86;  // space for web browser

  if (ADDIMAGES_POPUP_SHOW_ON_POPUP == 'true' && ($imagemenu->addimages_count > 1)) {
    list ($menu_width, $menu_height) = $imagemenu->boxsize();
    if (ADDIMAGES_POPUP_TABLE_LOCATION == 'sides') {
      $extra_window_width += $menu_width;
      if ($imagemenu->maximageheight < $menu_height) { $imagemenu->maximageheight = $menu_height; }
    }
    if (ADDIMAGES_POPUP_TABLE_LOCATION == 'above' || ADDIMAGES_POPUP_TABLE_LOCATION == 'below') {
      $extra_window_height += $menu_height;
      if ($imagemenu->maximagewidth < $menu_width) { $imagemenu->maximagewidth = $menu_width; }
    }
  }
  if(!empty($selected_image['products_image_description'])) {
    $imagemenu->maximageheight += 22; // add space for large image description text height
  }
}
// EOF: Additional Images


  $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
  $product_check = tep_db_fetch_array($product_check_query);
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<script language="javascript"><!--
function popupWindow(url) {
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150')
}
//--></script>
<?php // BOF: Additional Images ?>
<script language="javascript"><!--
function showImage(img,width,height,reptext) {
  if (document.getElementById("mainimage")) {
    document.getElementById("mainimage").src = img;
    document.getElementById("mainimage").height = height;
    document.getElementById("mainimage").width = width;
    document.getElementById("mainimage").title = reptext;
    document.getElementById("mainimage").alt = reptext;
    document.getElementById("mainimagedesc").innerHTML = reptext;
  }
}
//--></script>
<?php if (ENABLE_LIGHTBOX == 'true') { ?>
<!-- BOF: Lightbox Contribution -->
<script type="text/javascript" src="lightbox/prototype.js"></script>
<script type="text/javascript" src="lightbox/scriptaculous.js?load=effects"></script>
<link rel="stylesheet" href="lightbox/lightbox.css" type="text/css" media="screen">
<script type="text/javascript" src="lightbox/builder.js"></script>
<script type="text/javascript" src="lightbox/lightbox.js"></script>
<!-- EOF: Lightbox Contribution -->
<?php } ?>
<?php // EOF: Additional Images ?>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
  <tr>
    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
    </table></td>
<!-- body_text //-->
    <td width="100%" valign="top"><?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">
<?php
  if ($product_check['total'] < 1) {
?>
      <tr>
        <td><?php new infoBox(array(array('text' => TEXT_PRODUCT_NOT_FOUND))); ?></td>
      </tr>
      <tr>
        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
      </tr>
      <tr>
        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
          <tr class="infoBoxContents">
            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
              <tr>
                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
                <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
              </tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
<?php
  } else {
    // BOF: Additional Images: Added: , p.products_image_med, p.products_image_pop, p.products_image_description
    $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, p.products_image_med, p.products_image_pop, p.products_image_description, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
    // EOF: Additional Images    
    $product_info = tep_db_fetch_array($product_info_query);

    tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'");

    if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
      $products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
    } else {
      $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
    }

    if (tep_not_null($product_info['products_model'])) {
      $products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>';
    } else {
      $products_name = $product_info['products_name'];
    }
    // BOF: Additional Images
    $additional_images = new displayimages ( $product_info['products_id'] );
    // EOF: Additional Images
?>
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="pageHeading" valign="top"><?php echo $products_name; ?></td>
            <td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
      </tr>
      <tr>
        <td class="main">
<?php
// BOF: Additional Images    ADDED to if statement:  && ADDIMAGES_GROUP_WITH_PARENT == 'false'
    if (tep_not_null($product_info['products_image']) && ADDIMAGES_GROUP_WITH_PARENT == 'false') {
// EOF: Additional Images    
?>
<!-- // BOF: Additional Images  -->
          <table border="0" cellspacing="0" cellpadding="2" align="<?php echo ((ADDIMAGES_MENU_LOCATION=='product_info')?ADDIMAGES_TABLE_ALIGNMENT:ADDIMAGES_PARENT_IMAGE_ALIGNMENT); ?>"<?php if (ADDIMAGES_MENU_LOCATION == 'product_info') { echo ' width="'.($imagemenu->maximagewidth+$extra_window_width).'" height="'.($imagemenu->maximageheight+$extra_window_height).'"'; } ?> style="position: relative;">
<!-- // EOF: Additional Images  -->
            <tr>
              <td align="center" class="smallText">
<?php
// BOF: Additional Images
if (ADDIMAGES_MENU_LOCATION == 'product_info') {

    if (ADDIMAGES_POPUP_TABLE_LOCATION=='above' && ADDIMAGES_POPUP_SHOW_ON_POPUP=='true' && ($imagemenu->addimages_count > 1)) {
      echo '<table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td valign="middle" align="center" class="pageHeading">' . TEXT_MENU_TITLE . '</td></tr><tr><td valign="middle" align="center">' . $imagemenu->altgroupoutput() . '</td></tr></table>';
    }

    echo '<table border="0" cellspacing="0" cellpadding="0"><tr>';
    if (ADDIMAGES_POPUP_TABLE_LOCATION=='sides' && (ADDIMAGES_POPUP_TABLE_ALIGNMENT=='left' || ADDIMAGES_POPUP_TABLE_ALIGNMENT=='center') && ADDIMAGES_POPUP_SHOW_ON_POPUP=='true' && ($imagemenu->addimages_count > 1)) {
      echo '<td valign="middle" align="center" class="pageHeading">' . (TEXT_MENU_TITLE != ''?TEXT_MENU_TITLE . '<br>':'') . $imagemenu->groupoutput() . '</td>';
    }

    echo '<td valign="middle" align="center" width="' . $imagemenu->maximagewidth . '" height="' . $imagemenu->maximageheight . '">';
    if (!empty($_GET['imagesID'])) {
      if (ADDIMAGES_MENU_LOCATION == 'product_info' && ENABLE_LIGHTBOX == 'true') { // doing on page rollovers and the lightbox.
        echo tep_image(DIR_WS_IMAGES . (!empty($selected_image['medium_images'])?$selected_image['medium_images']:(!empty($selected_image['popup_images'])?$selected_image['popup_images']:'')), $selected_image['images_description'], (ADDIMAGES_POPUP_RESTRICT_IMAGE_SIZE=='true'?DISPLAY_IMAGE_WIDTH:''), (ADDIMAGES_POPUP_RESTRICT_IMAGE_SIZE=='true'?DISPLAY_IMAGE_HEIGHT:''), 'id="mainimage"') . '<br />' . (!empty($selected_image['images_description'])?'<span id="mainimagedesc">'.$selected_image['images_description'].'</span>':'');
      } else { // normal
        echo tep_image(DIR_WS_IMAGES . (!empty($selected_image['popup_images'])?$selected_image['popup_images']:(!empty($selected_image['medium_images'])?$selected_image['medium_images']:(!empty($selected_image['thumb_images'])?$selected_image['thumb_images']:''))), $selected_image['images_description'], (ADDIMAGES_POPUP_RESTRICT_IMAGE_SIZE=='true'?POPUP_IMAGE_WIDTH:''), (ADDIMAGES_POPUP_RESTRICT_IMAGE_SIZE=='true'?POPUP_IMAGE_HEIGHT:''), 'id="mainimage"') . '<br />' . (!empty($selected_image['images_description'])?'<span id="mainimagedesc">'.$selected_image['images_description'].'</span>':'');
      }
    } elseif (!empty($_GET['pID'])) {
      if (ADDIMAGES_MENU_LOCATION == 'product_info' && ENABLE_LIGHTBOX == 'true') { // doing on page rollovers and the lightbox.
        echo tep_image(DIR_WS_IMAGES . (!empty($selected_image['products_image_med'])?$selected_image['products_image_med']:(!empty($selected_image['products_image_pop'])?$selected_image['products_image_pop']:'')), $selected_image['images_description'], (ADDIMAGES_POPUP_RESTRICT_IMAGE_SIZE=='true'?DISPLAY_IMAGE_WIDTH:''), (ADDIMAGES_POPUP_RESTRICT_IMAGE_SIZE=='true'?DISPLAY_IMAGE_HEIGHT:''), 'id="mainimage"') . '<br />' . (!empty($selected_image['images_description'])?'<span id="mainimagedesc">'.$selected_image['images_description'].'</span>':'');
      } else { // normal
        echo tep_image(DIR_WS_IMAGES . (!empty($selected_image['products_image_pop'])?$selected_image['products_image_pop']:(!empty($selected_image['products_image_med'])?$selected_image['products_image_med']:(!empty($selected_image['products_image'])?$selected_image['products_image']:''))), $selected_image['products_image_description'], (ADDIMAGES_POPUP_RESTRICT_IMAGE_SIZE=='true'?POPUP_IMAGE_WIDTH:''), (ADDIMAGES_POPUP_RESTRICT_IMAGE_SIZE=='true'?POPUP_IMAGE_HEIGHT:''), 'id="mainimage"'). '<br />' . (!empty($selected_image['products_image_description'])?'<span id="mainimagedesc">'.$selected_image['products_image_description'].'</span>':'');
      }
    }
    echo '</td>';

    if (ADDIMAGES_POPUP_TABLE_LOCATION=='sides' && ADDIMAGES_POPUP_TABLE_ALIGNMENT=='right' && ADDIMAGES_POPUP_SHOW_ON_POPUP=='true' && ($imagemenu->addimages_count > 1)) {
      echo '<td valign="middle" align="center" class="pageHeading">' . (TEXT_MENU_TITLE != ''?TEXT_MENU_TITLE . '<br>':'') . $imagemenu->groupoutput() . '</td>';
    }
    if (!empty($imagemenu->maximagewidth) && !empty($imagemenu->maximageheight)) { echo '<td>' . tep_draw_separator('pixel_trans.gif', '4', $imagemenu->maximageheight) . '</td>'; }
    echo '</tr></table>';

    if (ADDIMAGES_POPUP_TABLE_LOCATION=='below' && ADDIMAGES_POPUP_SHOW_ON_POPUP=='true' && ($imagemenu->addimages_count > 1)) {
      echo '<table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td valign="middle" align="center" class="pageHeading">' . TEXT_MENU_TITLE . '</td></tr><tr><td valign="middle" align="center">' . $imagemenu->altgroupoutput() . '</td></tr></table>';
    }

} else {
if (ENABLE_LIGHTBOX == 'true') {
// lightbox addon
?><script language="javascript"><!--
document.write('<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image_pop']) . '"target="_blank" rel="lightbox[group]"  title="'. $product_info['products_name'].'" >' . tep_image(DIR_WS_IMAGES . (!empty($product_info['products_image_med'])?$product_info['products_image_med']:(!empty($product_info['products_image_pop'])?$product_info['products_image_pop']:(!empty($product_info['products_image'])?$product_info['products_image']:''))), addslashes($product_info['products_name']), (ADDIMAGES_RESTRICT_PARENT=='true'?DISPLAY_IMAGE_WIDTH:''), (ADDIMAGES_RESTRICT_PARENT=='true'?DISPLAY_IMAGE_HEIGHT:''), 'hspace="5" vspace="5"') . '<br>' . (!empty($product_info['products_image_description'])?$product_info['products_image_description']:TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>');
//--></script>
<noscript>
<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . (!empty($product_info['products_image_pop'])?$product_info['products_image_pop']:$product_info['products_image'])) . '" target="_blank" rel="lightbox[group]" title="'.$product_info['products_name'].'">' . tep_image(DIR_WS_IMAGES . (!empty($product_info['products_image_med'])?$product_info['products_image_med']:(!empty($product_info['products_image_pop'])?$product_info['products_image_pop']:(!empty($product_info['products_image'])?$product_info['products_image']:''))), $product_info['products_name'], (ADDIMAGES_RESTRICT_PARENT=='true'?DISPLAY_IMAGE_WIDTH:''), (ADDIMAGES_RESTRICT_PARENT=='true'?DISPLAY_IMAGE_HEIGHT:''), 'hspace="5" vspace="5"') . '<br>' . (!empty($product_info['products_image_description'])?$product_info['products_image_description']:TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>
</noscript><?php
} else {
// non-lightbox
?><script language="javascript"><!--
document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_ADD_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . (!empty($product_info['products_image_med'])?$product_info['products_image_med']:(!empty($product_info['products_image_pop'])?$product_info['products_image_pop']:(!empty($product_info['products_image'])?$product_info['products_image']:''))), addslashes($product_info['products_name']), (ADDIMAGES_RESTRICT_PARENT=='true'?DISPLAY_IMAGE_WIDTH:''), (ADDIMAGES_RESTRICT_PARENT=='true'?DISPLAY_IMAGE_HEIGHT:''), 'hspace="5" vspace="5"') . '<br>' . (!empty($product_info['products_image_description'])?$product_info['products_image_description']:TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>');
//--></script>
<noscript>
<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . (!empty($product_info['products_image_pop'])?$product_info['products_image_pop']:$product_info['products_image'])) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . (!empty($product_info['products_image_med'])?$product_info['products_image_med']:(!empty($product_info['products_image_pop'])?$product_info['products_image_pop']:(!empty($product_info['products_image'])?$product_info['products_image']:''))), $product_info['products_name'], (ADDIMAGES_RESTRICT_PARENT=='true'?DISPLAY_IMAGE_WIDTH:''), (ADDIMAGES_RESTRICT_PARENT=='true'?DISPLAY_IMAGE_HEIGHT:''), 'hspace="5" vspace="5"') . '<br>' . (!empty($product_info['products_image_description'])?$product_info['products_image_description']:TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>
</noscript><?php
}
}
// EOF: Additional Images ?>
              </td>
            </tr>
          </table>
<?php
    }
// BOF: Additional Images
    if (ADDIMAGES_TABLE_LOCATION=='above' && ADDIMAGES_SHOW_ON_PRODUCT_INFO=='true' && ADDIMAGES_MENU_LOCATION == 'popup') {
      echo $additional_images->altgroupoutput();
    } else if (ADDIMAGES_TABLE_LOCATION=='sides' && ADDIMAGES_SHOW_ON_PRODUCT_INFO=='true' && ADDIMAGES_MENU_LOCATION == 'popup') {
      echo $additional_images->groupoutput();
    }
// EOF: Additional Images
?>
          <p><?php echo stripslashes($product_info['products_description']); ?></p>
<?php
    $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'");
    $products_attributes = tep_db_fetch_array($products_attributes_query);
    if ($products_attributes['total'] > 0) {
?>
          <table border="0" cellspacing="0" cellpadding="2">
            <tr>
              <td class="main" colspan="2"><?php echo TEXT_PRODUCT_OPTIONS; ?></td>
            </tr>
<?php
      $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name");
      while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {
        $products_options_array = array();
        $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");
        while ($products_options = tep_db_fetch_array($products_options_query)) {
          $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);
          if ($products_options['options_values_price'] != '0') {
            $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
          }
        }

        if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) {
          $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];
        } else {
          $selected_attribute = false;
        }
?>
            <tr>
              <td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td>
              <td class="main"><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?></td>
            </tr>
<?php
      }
?>
          </table>
<?php
    }
?>
        </td>
      </tr>
<?php // BOF: Additional Images
if (ADDIMAGES_TABLE_LOCATION=='below' && ADDIMAGES_SHOW_ON_PRODUCT_INFO=='true' && ADDIMAGES_MENU_LOCATION == 'popup') { ?>
      <tr>
        <td><?php echo $additional_images->altgroupoutput(); ?></td>
      </tr>
<?php }
// EOF: Additional Images ?>
      <tr>
        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
      </tr>
<?php
    $reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
    $reviews = tep_db_fetch_array($reviews_query);
    if ($reviews['count'] > 0) {
?>
      <tr>
        <td class="main"><?php echo TEXT_CURRENT_REVIEWS . ' ' . $reviews['count']; ?></td>
      </tr>
      <tr>
        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
      </tr>
<?php
    }

    if (tep_not_null($product_info['products_url'])) {
?>
      <tr>
        <td class="main"><?php echo sprintf(TEXT_MORE_INFORMATION, tep_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($product_info['products_url']), 'NONSSL', true, false)); ?></td>
      </tr>
      <tr>
        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
      </tr>
<?php
    }

    if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) {
?>
      <tr>
        <td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])); ?></td>
      </tr>
<?php
    } else {
?>
      <tr>
        <td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_ADDED, tep_date_long($product_info['products_date_added'])); ?></td>
      </tr>
<?php
    }
?>
      <tr>
        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
      </tr>
      <tr>
        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
          <tr class="infoBoxContents">
            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
              <tr>
                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
                <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?></td>
                <td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>
                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
              </tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
      </tr>
      <tr>
        <td>
<?php
    if ((USE_CACHE == 'true') && empty($SID)) {
      echo tep_cache_also_purchased(3600);
    } else {
      include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);
    }
  }
?>
        </td>
      </tr>
    </table></form></td>
<!-- body_text_eof //-->
    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
    </table></td>
  </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

If someone could help me it would be very very kind.

Share this post


Link to post
Share on other sites

@@aurelou,

 

I'm sorry I do not use this add-on and integration like you say is not easy. Or you find someone who did this already and give you the code or you should ask for help in the commercial support forum. It is impossible to integrate it in mobile without the additional image add-on installed in a develop store together with iosc mobile or having access to your store.

 

rgds

Rainer

Share this post


Link to post
Share on other sites

Hello @@raiwa,

 

I just need a little help, I hope you can help me without knowing the additional image addon.

 

I managed to show my additional images thumbnails in the product info page but when I want to open them, the image is not found because the source is from catalog/mobile/images/

 

The path needs to be from the root : catalog/images/

 

<?php // BOF: Additional Images

if (ADDIMAGES_SHOW_ON_PRODUCT_INFO=='true' && ADDIMAGES_MENU_LOCATION == 'popup') { ?>
      <tr>
        <td><?php echo $additional_images->altgroupoutput(); ?></td>
        
      </tr>
<?php }
// EOF: Additional Images ?>

 

 

How to code it ?

 

Thank you a lot.

Share this post


Link to post
Share on other sites

Hello @@aurelou,

 

It seems your add on uses an additional class probably called "displayimages".

You should check there within the "altgroupoutput" function for the image path definition.

It looks like the image directory is hardcoded there. Try to change it to use the directory definition: DIR_WS_IMAGES instead of 'images/'.

 

If this doesn't work, try to use the mobile session statement:

 

 if (defined('MOBILE_SESSION')) {

      'my mobile image path';

} else {

      'my classic image path';

}

 

 

use the actual image path for classic and modify the mobile path adding 2 dots and slash in front of "images/"

 

so that part should look like this:

"../images/"

 

Please check also points 6 and 10b in the Add-On Support doc.

 

Hope this helps

 

kind regards

Rainer

Share this post


Link to post
Share on other sites

Hello @@raiwa,

 

Thanks a lot :) :)

 

As you said it was in the class displayimages.php, there was a line with the images path which was hardcoded. I changed it and it works. Now I have other issues but before asking I'll try to figure it out.

Edited by aurelou

Share this post


Link to post
Share on other sites

Hello @@raiwa,

 

Sorry to disturb you again.

 

I have another issue that I don't understand, after having tried to install the additionnal images addon.

 

When I open a product info page, all that shows is one of the additional images. Except that it's a blank page. No header, nothing else. Then when I refresh the page, it appears correctly with all the informations of the product info page and my additional images. But it never appears correctly without refreshing the page.

 

Do you know where this could come from ? I don't know if I can put the link.

 

Thanks a lot for your help.

Share this post


Link to post
Share on other sites

Hello @@aurelou,
 
This sounds like your image add-on script has problems with the ajax page load.
Please try the following:
In: Admin => Configuration => Mobile Site => Enable Ajax page load => set to "false"
 
If it works then on first page load, exclude the product info page from ajax page load like explained in the Add-On Support doc point 11B.
You may also need to add the data-ajax="false" tag to all the links pointing to the product info page like explained in point 11A.

 

Then you can switch the main setting again to "true".

 

hope this helps

 

regards

Rainer

Share this post


Link to post
Share on other sites

Hi,
 
is this the normal search engine behavior with mobile product and category pages submitted via sitemap? (the mobile pages dont get indexed by google)
mg2D2OO.png

http://i.imgur.com/mg2D2OO.png
 
i am using a canonical link on mobile page and desktop page pointing to the desktop page, where the desktop page shows an alternate link to the mobile page also.
 

mobile pages are in a /mobile/ subfolder (so no seperate mobile subdomain) and
robots meta tag on mobile and desktop page is 

<meta name="robots" content="index,follow,noodp,noydir">
Edited by Stephan Gebbers

 

 

Share this post


Link to post
Share on other sites

Hello @@raiwa,

Thank you again for your help, and sorry, I feel bad to disturb you with all my issues.

When I set to false "Enable Ajax page load" in the Admin, the problem remains. However, the Ajax page load seems to remain in all pages even if it's set to false. I'm not sure but the little ajax-loader.gif is still there when all pages are loaded. Is it normal ?

I also tried points 11A and 11B from the Add-On Support doc but nothing changes.

Share this post


Link to post
Share on other sites

Hello @@aurelou,

 

No problem. You need to delete your session to get the configuration change to take effect. You can do it directly in the database or login to an account should change the session or try to access from another computer or browser once you changed the setting.

 

regards

Rainer

Share this post


Link to post
Share on other sites

Hello @@Stephan Gebbers,

 

It may take some time until Google gets the mobile URLs indexed. However as mobile users will be redirected to the mobile URLs it is not so important.

Share this post


Link to post
Share on other sites

Hello @@raiwa,

 

Thank you again, it is really weird... I tried to log with another session, cleaned all the session table from the database and the ajax page load still remains even if it's set to false.

 

I also aded this in header.php :

if (AJAX_ENABLED != 'true' || substr(basename($PHP_SELF), 0, 8) == 'checkout' || basename($PHP_SELF) == FILENAME_CATALOG_MB || substr(basename($PHP_SELF), 0, 7) == 'account' || substr(basename($PHP_SELF), 0, 12) == 'address_book'  || substr(basename($PHP_SELF), 0, 12) == 'product_info)' || basename($PHP_SELF) == FILENAME_LOGIN || basename($PHP_SELF) == FILENAME_CREATE_ACCOUNT)

I also tried to add this in products_listview.php :

 $path = tep_mobile_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing['products_id'], 'data-ajax="false"');

I don't understand...

Share this post


Link to post
Share on other sites

@@aurelou,

 

I checked it yesterday on my test store and it works there.

 

You should have in the mobile header:

/* Desactivate Ajax for the checkout and catalog_mb pages !*/
if (AJAX_ENABLED != 'true' || substr(basename($PHP_SELF), 0, 8) == 'checkout' || basename($PHP_SELF) == FILENAME_CATALOG_MB || substr(basename($PHP_SELF), 0, 7) == 'account' || substr(basename($PHP_SELF), 0, 12) == 'address_book' || basename($PHP_SELF) == FILENAME_LOGIN || basename($PHP_SELF) == FILENAME_CREATE_ACCOUNT)
echo '<script type="text/javascript">
$(document).bind("mobileinit", function () {
    $.mobile.ajaxEnabled = false;
});
</script>';
?>

Otherwise for testing you can remove the line with the if statement and just leave the script which disables ajax page load:

/* Desactivate Ajax for the checkout and catalog_mb pages !*/
echo '<script type="text/javascript">
$(document).bind("mobileinit", function () {
    $.mobile.ajaxEnabled = false;
});
</script>';
?>

Check also if you have no extra lines between the if statement and the echoed script or try this version:

/* Desactivate Ajax for the checkout and catalog_mb pages !*/
if (AJAX_ENABLED != 'true' || substr(basename($PHP_SELF), 0, 8) == 'checkout' || basename($PHP_SELF) == FILENAME_CATALOG_MB || substr(basename($PHP_SELF), 0, 7) == 'account' || substr(basename($PHP_SELF), 0, 12) == 'address_book' || basename($PHP_SELF) == FILENAME_LOGIN || basename($PHP_SELF) == FILENAME_CREATE_ACCOUNT) {
echo '<script type="text/javascript">
$(document).bind("mobileinit", function () {
    $.mobile.ajaxEnabled = false;
});
</script>';
}
?>

regards

Rainer

Edited by raiwa

Share this post


Link to post
Share on other sites

Thank you @@raiwa, I tried everything and unfortunately nothing changes. When I remove the line with the if statement, the ajax load still remains.

 

I clear the session table every time I make a change.

 

Just when I click on my account or on the catalog, there's no ajax load.

Edited by aurelou

Share this post


Link to post
Share on other sites

@@aurelou,

 

continue trying. If it doesn't show on catalog, it must work also for the product page

Share this post


Link to post
Share on other sites

@@parduotuve,

 

the jquery mobile files and/or css are not loading.

Please check if you copied all files in the directory: mobile/ext/

Then did you run the database installation script: mobile_db_setup_v4r2.php?

Then did you change any setting in: Admin => Configuration => Mobile Site =>Osc Theme ?

 

Check all of this, if it doesnt help please post or PM your store URL

 

Kind regards

Rainer

Share this post


Link to post
Share on other sites

@@parduotuve,

 

the jquery mobile files and/or css are not loading.

Please check if you copied all files in the directory: mobile/ext/

Then did you run the database installation script: mobile_db_setup_v4r2.php?

Then did you change any setting in: Admin => Configuration => Mobile Site =>Osc Theme ?

 

Check all of this, if it doesnt help please post or PM your store URL

 

Kind regards

Rainer

Well first of all sheesh you're fast. :o

 

Yep there must be something wrong with admin config. Default values are: Osc,Oscmobile,Grey.

By saying change it to Osc Theme you mean it literaly change it to value "Osc Theme"? I can see that it says "(see next step 3b):" which is where?

I tried changing it to Osc Theme but didn't worked so I assume it has to be the same as my default classic theme? If yes then where can I find it?

 

P.S. Also I'm getting this warning it might be unrelated:

 

Warning: include(includes/classes/action_recorder.php): failed to open stream: No such file or directory in /var/webs/includes/application_top.php on line 320 Warning: include(): Failed opening 'includes/classes/action_recorder.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/webs/includes/application_top.php on line 320

Edited by parduotuve

Share this post


Link to post
Share on other sites

So if anyone gonna have similair issue and do not care about theme switching just hardcode it:

Open catalog/mobile/includes/header.php 

 

Find:

<link rel="stylesheet" href="ext/css/theme-<?php echo CSS;?>-min.css?time=<?php echo time()?>" />

 

Replace:

<link rel="stylesheet" href="ext/css/theme-Grey-min.css?time=<?php echo time()?>" />

 

P.S. you can chose other theme just change Grey to whatever.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×