Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

DAVID3733

Members
  • Posts

    296
  • Joined

  • Last visited

About DAVID3733

  • Birthday 01/01/1964

Profile Information

Recent Profile Visitors

19,153 profile views

DAVID3733's Achievements

  1. Hi A friend of mine is playing with a module he purchased on Presta shop, to add to cart via WhatsApp, it creates a order on the server etc and then they can phone in to pay etc. separate button to chat via whatsapp Not seen anything available for eCommerce yet, has anyone created something similar as a module, paid or otherwise. David
  2. Can confirm this worked for me Thank you for sharing
  3. Hi Yes I thought it would be easy, unfortunately I am not a coder, not even close looking at the page it appears to be able to get the EN and FR URL, this is so it can get the alternate lang for the HrefLang But if I understand the X-Default correct requirement right, in my case I want to tell Google that my fallback language is English Although I am unable to read the code properly on the code I would imagine the Lang Variable on the page is indeed for the Language its on then swaps over to the other Lang for both languages so it probably could not slip straight into the existing variable I am sure this could be hardcoded something like <link rel="alternate" href="https://www. websitepage_I_am_on_now.com(English)/" hreflang="x-default" /> as it only needs to be one language, the fall back one, But like I say no coder so do not know how to move forward
  4. If you can tell me how to add it to the previous version below I can let you know in a few weeks if it works and gets listed for Goggle as I have thousands of pages listed as alternatives, en and FR already in google and have for at least a year, just not X-default🙂 <?php class FWR_hreflang { protected $page; protected $mode; protected $get; protected $lng; protected $language; protected $root_path; protected $language_image_width = '24'; protected $language_image_height = '15'; protected $session_started; protected $language_code_array = array(); protected $links_icons; protected $links_list; protected $alternate_hreflang; protected $lang_array; public function __construct( navigationHistory $navigation, $language, $lng = false, $session_started = false ) { require(DIR_FS_CATALOG . 'includes/languages/' . $language . '/hreflang.php'); $navigation_data = array_pop( $navigation->path ); $this->page = $navigation_data['page']; $this->mode = $navigation_data['mode']; $this->get = $navigation_data['get']; $this->setLanguage( $lng ); $this->language = $language; $this->root_path = realpath( dirname( __FILE__ ) . '/../../' ) . '/'; $this->session_started = $session_started; $this->getLanguageSelectionHtml(); } // Returns an unordered list of links to the public function __toString() { return $this->links_icons; } // Returns an array containing data of all alternate languages (other than current language) public function lang_array() { return $this->lang_array; } // Returns an array containing data of all alternate languages (other than current language) public function links_list() { return $this->links_list; } public function hreflang_tags() { // Returns a string containing all the hreflang tags pertinent to this page (other than current language) return $this->alternate_hreflang; } protected function setLanguage( $lng ) { if ( ( false === $lng ) || ( !$lng instanceof language ) ) { include_once 'includes/classes/language.php'; $this->lng = new language(); $this->setLanguageArray(); return $this->lng; } $this->lng = $lng; $this->setLanguageArray(); } protected function setLanguageArray() { foreach ( $this->lng->catalog_languages as $code => $unused ) { $this->language_code_array[] = $code; } } protected function getLanguageSelectionHtml() { global $languages_id,$language; $alternate = $links_icons = $links_list = ""; $output = '<ul style="list-style-type:none; padding:0; margin:0;">'; foreach ( $this->lng->catalog_languages as $code => $data ) { // Sets USU language to the current selection Usu_Main::i()->initiate( array(), $data['id'], $data['directory'], true ); $language_image_path = 'includes/languages/' . $data['directory'] . '/images/icon.gif'; $this_link = $this->buildLink( $default = ( $code === DEFAULT_LANGUAGE ), $code ); $hr [$data['id']]['id']=$data['id']; $hr [$data['id']]['name']=$data['name']; $hr [$data['id']]['image']=$data['image']; $hr [$data['id']]['directory']=$data['directory']; $hr [$data['id']]['href']=$this_link ; $alternate .= '<link rel="alternate" hreflang="' . $code . '" href="' . $this_link . '" />' . PHP_EOL; if ( $data['directory'] != $this->language ) { $links_icons .= ' <a href="' . $this_link . '">' . tep_image($language_image_path, $data['name'], NULL, NULL, NULL, false) . '</a>'; $links_list .= '<a class="dropdown-item" href="' . $this_link . '">' . tep_image($language_image_path, $data['name'], NULL, NULL, NULL, false) . '&nbsp;' . LANGUAGES_CHANGE_TO . "&nbsp;" . $data['name'] . '</a>' . PHP_EOL; } } $this->links_list = $links_list; $this->links_icons = $links_icons; $this->alternate_hreflang = $alternate; $this->lang_array =$hr; // Resets USU language to the current language for the rest of the links on the page Usu_Main::i()->initiate( array(), $languages_id, $language, true ); } protected function buildLink($default = false, $code ) { if ( false === $this->session_started ) { // return $this->multiLanguage( tep_href_link( 'index.php', '', 'NONSSL' ), $default, $code ); } $curlink = tep_href_link ($this->page, $this->getQuery(), $this->mode, true, false, $code); return $this->multiLanguage( $curlink , $default, $code ); } protected function getQuery() { if ( tep_not_null( $this->get ) ) { if ( array_key_exists( tep_session_name(), $this->get ) ) { unset( $this->get[tep_session_name()] ); } return http_build_query( $this->get ); } return ''; } protected function removeQueryString( $target ) { if ( false === strpos( $target, '?' ) ) { return $target; } return substr( $target, 0, strpos( $target, '?' ) ); } protected function removeLanguageMarkers( $target, $cookie_path ) { $return = preg_replace( '@' . $cookie_path . '(' . implode( '|', $this->language_code_array ) . ')/@', $cookie_path, $target ); $return = preg_replace( '@' . $this->page . '/(' . implode( '|', $this->language_code_array ) . ')@', $this->page, $return ); return $return; } protected function multiLanguage( $link, $default, $code ) { $server = ( $this->mode == 'NONSSL' ) ? HTTP_SERVER : HTTPS_SERVER; $cookie_path = ( $this->mode == 'NONSSL' ) ? HTTP_COOKIE_PATH : HTTPS_COOKIE_PATH; $server = $server . $cookie_path; $link = $this->removeLanguageMarkers( $link, $cookie_path ); if ( false !== $default ) { $no_querystring = $this->removeQueryString( $link ); // Is the page FILENAME_DEFAULT and after the querystring is removed is FILENAME_DEFAULT the ending characters of the URL, if so we chop it off leaving just the domain if ( ( $this->page == 'index.php' ) && ( substr( $no_querystring, ( strlen( $no_querystring ) - strlen( $this->page ) ), strlen( $no_querystring ) ) == $this->page ) ) { return str_replace( $this->page, '', $link ); } return $link; } // If the .php filename is present in the link if ( false !== strpos( $link, $this->page ) ) { return str_replace( $this-> page, $this->page . '/' . $code, $link ); } return str_replace( $server, $server . $code . '/', $link ); } }
  5. Hi piernas Glad you are still improving and updating this addon, for people like me who have very old URLS and do not want to lose the history of the links its very important. Has X-default in the Hreflang alternate language been addressed yet If I have understood it correct its just the fallback language of the page, for example my site is in english, most of the world is in english, I have a a alternate lang in FR there should also be a x-default alternate on all pages including the FR ones to the English should be a easy thing to have as all the data is on the page in USU5, just wish I knew how to do it. somewhere around here $alternate .= '<link rel="alternate" hreflang="' . $code . '" href="' . $this_link . '" />' . PHP_EOL; if ( $data['directory'] != $this->language ) { $links_icons .= ' <a href="' . $this_link . '">' . tep_image($language_image_path, $data['name'], NULL, NULL, NULL, false) . '</a>'; $links_list .= '<a class="dropdown-item" href="' . $this_link . '">' . tep_image($language_image_path, $data['name'], NULL, NULL, NULL, false) . '&nbsp;' . LANGUAGES_CHANGE_TO . "&nbsp;" . $data['name'] . '</a>' . PHP_EOL; } } David
  6. I have installed this on 2.3.4bs quite close to phoenix, easy install, can see the Google box so assume its all working on contact and create account Would think a good addition would be product pages as well, assume it would help with bots scraping, has anyone done this? Regards David
  7. Not sure what base version of the module I am using but i have somethng like thats on 2.3.4bs4 php 7.216 chdir('../'); include_once 'includes/application_top.php'; $use_mysqli = true; if (function_exists('tep_get_version')) { $ver = tep_get_version(); if (isset($ver[4]) && $ver[4] > 1) { //only versions after 2.3.1 use mysqli $use_mysqli = true; } } $myfetch_mysql = ($use_mysqli ? mysqli_fetch_object : mysql_fetch_object);
  8. I take that back, it cause other issues, if i ever find the right method i will post back
  9. Can confirm with a bit of jiggling it will work in httpd.conf had to change RewriteRule ^([a-z0-9/-]+)-c-([0-9_]+)\.html$ index.php? [NC,L,QSA] to RewriteRule ^([a-z0-9/-]+)-c-([0-9_]+)\.html$ /index.php?cPath=$2 [NC,L,QSA] although have problem with popup image not working now, not sure if that related though to URLS5
  10. Fully aware of this, I have a number of reasons, mainly because of speed and its my server main htaccess file takes me longer to upload than restarting Apache, both knock the website out so not a consideration
  11. Hello Does anybody have URLS 5 Pro working (rewrite) using httpd.conf rather than .htaccess, I want to move over to zero .htaccess files but think this is stopping me Thank you David
  12. If it helps anyone I got it workings $parameters = '?view=all'; $detail = array(); usu5_xml_init( $doc, $root); $categories = buildCategoriesCache(); foreach ( $categories as $cid => $detail ) { if( preg_match( '@[0-9_]@', $detail['path'] ) ) { $detail = array( 'url' => (tep_href_link( 'index.php', 'cPath=' . $detail['path'], 'NONSSL', false ) . $parameters), 'lastmod' => date( "Y-m-d", strtotime($detail['last_mod'] ) ), 'freq' => 'weekly', 'priority' => '0.5' ); usu5_node_create( $doc, $root, $detail ); Regards
  13. Hi I use the xml site map function as well, it produes two languages and all works as should But I canonical all of my categories to ?Viewall I am struling getting the sitemap to list this I thought it would be easy enough, in usu5_itemaps/index.php I edited the following to something like foreach ( $categories as $cid => $detail ) { if( preg_match( '@[0-9_]@', $detail['path'] ) ) { //took out $detail = array( 'url' => tep_href_link( 'index.php', 'cPath=' . $detail['path'], 'NONSSL', false ), //and added ."?viewall" $detail = array( 'url' => tep_href_link( 'index.php', 'cPath=' . $detail['path']."?viewall", 'NONSSL', false ), 'lastmod' => date( "Y-m-d", strtotime($detail['last_mod'] ) ), 'freq' => 'weekly', 'priority' => '0.5' ); usu5_node_create( $doc, $root, $detail ); } } while this does not break it list the URL as a cPath (plus the correct appended ?viewall ) and not the seo version it should Tried loads of different ways, could someone point me in the correct path to resolving it, suspect its very simple just Thank you David
  14. Hi no a coder, in UK 20% vat standard rate i have at different parts of the page define('OPTIONS_ENABLED_INCLUDE_TAX', 2); //0 = no tax, 1 = uses google method, 2 = UK Vat ....................................... define('OPTIONS_TAX_RATE' , '20.0'); //default = 0 (e.g. for 20.0% tax use "$taxRate = 20.0;") //only used in the next line define('OPTIONS_TAX_CALC', (OPTIONS_ENABLED_INCLUDE_TAX == 2 ? (OPTIONS_TAX_RATE/100) + 1 : '1')); //UK. US tax rate - US is ignorded since it is 1 .................... if(OPTIONS_ENABLED_INCLUDE_TAX == 1 || OPTIONS_ENABLED_INCLUDE_TAX == 3) $output .= "\ttax"; ...................................... if (OPTIONS_ENABLED_INCLUDE_TAX == 3) { $db_query = tep_db_query("select tax_rate from " . TABLE_TAX_RATES . " where tax_rates_id = " . (int)$row->tax_id); $db = tep_db_fetch_array($db_query); if ($db['tax_rate'] > 0) { $price_w_tax = $row->price_no_tax + (round($row->price_no_tax * ($db['tax_rate']/100),2)); //echo 'price '.$row->id. ' W TAX= ' . $row->price . ' No Tax= '.$row->price_no_tax .' CALC= '. $price_w_tax . ' ' .$row->tax_id.'<br>'; $row->price = $price_w_tax; } //else price uses the default tax } //else price uses the default tax ............................ if(OPTIONS_ENABLED_INCLUDE_TAX == 1) $output .= "\t" . OPTIONS_TAX_STRING; Not sure if i have edited this myself of found it in the forums, but it works I have some items that are zero vat rated, so it may be different David
×
×
  • Create New...