Jump to content

zigojacko

Members
  • Posts

    18
  • Joined

  • Last visited

About zigojacko

  • Birthday 07/11/1982

Contact Methods

  • AIM
    zigojacko
  • MSN
    zigojacko@hotmail.com
  • Website URL
    http://www.clubnetsem.com
  • ICQ
    69531090
  • Yahoo
    zigojacko
  • Skype
    zigojacko

Profile Information

  • Gender
    Male
  • Location
    UK

zigojacko's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks for your replies. I figured it out now... $gallery_images = Mage::getModel('catalog/product')->load($product->getId())->getMediaGalleryImages(); $items = array(); foreach($gallery_images as $g_image) { $items[] = $g_image['url']; } Then I could fetch them outside of the loop with:- implode(', ', $items); Thanks for your replies anyway...
  2. I don't think I explained well (or correctly). I think $product->getMediaGallery() is an object. The output of var_dump ($product->getMediaGalleryImages()); is below:- object(Varien_Data_Collection)#402 (13) { ["_items":protected]=> array(5) { [226]=> object(Varien_Object)#401 (7) { ["_data":protected]=> array(12) { ["value_id"]=> string(3) "226" ["file"]=> string(35) "/k/i/kimono-sleeve-top-black_1_.jpg" ["product_id"]=> string(2) "51" ["label"]=> string(55) "silk print bamboo kimono sleeve zip top " ["position"]=> string(1) "1" ["disabled"]=> string(1) "0" ["label_default"]=> string(55) "silk print bamboo kimono sleeve zip top " ["position_default"]=> string(1) "1" ["disabled_default"]=> string(1) "0" ["url"]=> string(89) "https://www.example.com/media/catalog/product/k/i/kimono-sleeve-top-black_1_.jpg" ["id"]=> string(3) "226" ["path"]=> string(102) "/var/www/vhosts/example.com/httpdocs/media/catalog/product/k/i/kimono-sleeve-top-black_1_.jpg" } ["_hasDataChanges":protected]=> bool(false) ["_origData":protected]=> NULL ["_idFieldName":protected]=> NULL ["_isDeleted":protected]=> bool(false) ["_oldFieldsMap":protected]=> array(0) { } ["_syncFieldsMap":protected]=> array(0) { } } [227]=> object(Varien_Object)#374 (7) { ["_data":protected]=> array(12) { ["value_id"]=> string(3) "227" ["file"]=> string(35) "/k/i/kimono-sleeve-top-black_2_.jpg" ["product_id"]=> string(2) "51" ["label"]=> string(60) "silk print bamboo kimono sleeve zip top front" ["position"]=> string(1) "2" ["disabled"]=> string(1) "0" ["label_default"]=> string(60) "silk print bamboo kimono sleeve zip top front" ["position_default"]=> string(1) "2" ["disabled_default"]=> string(1) "0" ["url"]=> string(89) "https://www.example.com/media/catalog/product/k/i/kimono-sleeve-top-black_2_.jpg" ["id"]=> string(3) "227" ["path"]=> string(102) "/var/www/vhosts/example.com/httpdocs/media/catalog/product/k/i/kimono-sleeve-top-black_2_.jpg" } ["_hasDataChanges":protected]=> bool(false) ["_origData":protected]=> NULL ["_idFieldName":protected]=> NULL ["_isDeleted":protected]=> bool(false) ["_oldFieldsMap":protected]=> array(0) { } ["_syncFieldsMap":protected]=> array(0) { } } [225]=> object(Varien_Object)#375 (7) { ["_data":protected]=> array(12) { ["value_id"]=> string(3) "225" ["file"]=> string(35) "/k/i/kimono-sleeve-top-black_3_.jpg" ["product_id"]=> string(2) "51" ["label"]=> string(62) "silk print bamboo kimono sleeve zip top quarter" ["position"]=> string(1) "3" ["disabled"]=> string(1) "0" ["label_default"]=> string(62) "silk print bamboo kimono sleeve zip top quarter" ["position_default"]=> string(1) "3" ["disabled_default"]=> string(1) "0" ["url"]=> string(89) "https://www.example.com/media/catalog/product/k/i/kimono-sleeve-top-black_3_.jpg" ["id"]=> string(3) "225" ["path"]=> string(102) "/var/www/vhosts/example.com/httpdocs/media/catalog/product/k/i/kimono-sleeve-top-black_3_.jpg" } ["_hasDataChanges":protected]=> bool(false) ["_origData":protected]=> NULL ["_idFieldName":protected]=> NULL ["_isDeleted":protected]=> bool(false) ["_oldFieldsMap":protected]=> array(0) { } ["_syncFieldsMap":protected]=> array(0) { } } [228]=> object(Varien_Object)#319 (7) { ["_data":protected]=> array(12) { ["value_id"]=> string(3) "228" ["file"]=> string(35) "/k/i/kimono-sleeve-top-black_4_.jpg" ["product_id"]=> string(2) "51" ["label"]=> string(59) "silk print bamboo kimono sleeve zip top back" ["position"]=> string(1) "4" ["disabled"]=> string(1) "0" ["label_default"]=> string(59) "silk print bamboo kimono sleeve zip top back" ["position_default"]=> string(1) "4" ["disabled_default"]=> string(1) "0" ["url"]=> string(89) "https://www.example.com/media/catalog/product/k/i/kimono-sleeve-top-black_4_.jpg" ["id"]=> string(3) "228" ["path"]=> string(102) "/var/www/vhosts/example.com/httpdocs/media/catalog/product/k/i/kimono-sleeve-top-black_4_.jpg" } ["_hasDataChanges":protected]=> bool(false) ["_origData":protected]=> NULL ["_idFieldName":protected]=> NULL ["_isDeleted":protected]=> bool(false) ["_oldFieldsMap":protected]=> array(0) { } ["_syncFieldsMap":protected]=> array(0) { } } [229]=> object(Varien_Object)#327 (7) { ["_data":protected]=> array(12) { ["value_id"]=> string(3) "229" ["file"]=> string(35) "/k/i/kimono-sleeve-top-black_5_.jpg" ["product_id"]=> string(2) "51" ["label"]=> string(61) "silk print bamboo kimono sleeve zip top detail" ["position"]=> string(1) "5" ["disabled"]=> string(1) "0" ["label_default"]=> string(61) "silk print bamboo kimono sleeve zip top detail" ["position_default"]=> string(1) "5" ["disabled_default"]=> string(1) "0" ["url"]=> string(89) "https://www.example.com/media/catalog/product/k/i/kimono-sleeve-top-black_5_.jpg" ["id"]=> string(3) "229" ["path"]=> string(102) "/var/www/vhosts/example.com/httpdocs/media/catalog/product/k/i/kimono-sleeve-top-black_5_.jpg" } ["_hasDataChanges":protected]=> bool(false) ["_origData":protected]=> NULL ["_idFieldName":protected]=> NULL ["_isDeleted":protected]=> bool(false) ["_oldFieldsMap":protected]=> array(0) { } ["_syncFieldsMap":protected]=> array(0) { } } } ["_itemObjectClass":protected]=> string(13) "Varien_Object" ["_orders":protected]=> array(0) { } ["_filters":protected]=> array(0) { } ["_isFiltersRendered":protected]=> bool(false) ["_curPage":protected]=> int(1) ["_pageSize":protected]=> bool(false) ["_totalRecords":protected]=> NULL ["_isCollectionLoaded":protected]=> NULL ["_cacheKey":protected]=> NULL ["_cacheTags":protected]=> array(0) { } ["_cacheLifetime":protected]=> int(86400) ["_flags":protected]=> array(0) { } } I have replaced references to the domain with example.com. I need to print a list of the ["url"] that can be seen in this var_dump and I don't know the correct syntax to do this. Hope that explains a bit better.
  3. Of course. It's the first place I look. I couldn't resolve it after trying things from the manual... Syntactically, I don't think this is right:- $array = array($product->getMediaGallery()); So, the following returns NULL:- var_dump ($array["url"]); In case you've missed the obvious, I'm not really sure what I am doing with this hence why I have come here for help.
  4. I need to list an array (comma separated) and the data I need is available in the var_dump. I just don't know how to write the syntax to display the array list. From within: var_dump ($product->getMediaGalleryImages()); I can see multiple instances of: ["url"]=> string(89) "https://www.example.com/media/catalog/product/x/x/x-image.jpg" What do I need to write in order to list all the ["url"] Thanks in advance.
  5. I just want to clarify what this line means... <?php if(get_post_meta($id, "title_override_text", true) !== '') { ?> Is this saying, if 'title_override_text' exists but doesn't contain any value? Thanks in advance.
  6. Hah, brilliant, Yes this cuts out a ton of ridiculous code in the file and achieves the same (desired) result. Thanks very much
  7. This is a completely bespoke ecommerce website and the code is an absolute mess. None of it has anything to do with me but unfortantely, I'm going to have to fix up some of it in order to get certain things to happen. Thanks very much for taking the time to help on this.
  8. if ($CheckCanoNi[1] != '' && $_REQUEST['perpage'] == '') is if perpage=[nothing]. if ($CheckCanoNi[1] != '' && $_REQUEST['perpage'] == '36') is if perpage=36 I need to say if perpage contains any value... If it is null I don't think it achieves that? Thanks
  9. Brilliant, starting to make sense. Thanks. If the 'p' argument is 1, does that mean if it exists? I've tested with if ($CheckCanoNi[1] != '' && $_REQUEST['perpage'] == '36') and this works perfectly, canonical tag is rendered if the query parameter perpage=36. How could I set it to say if it contains anything at all? Thanks for your help on that. (I didn't leave out the quotes, they just didn't exist in the first place - I've now added them my end - thanks).
  10. $CanoNi = $_SERVER['REQUEST_URI']; $CheckCanoNi = explode('?',$CanoNi); if($CheckCanoNi[1] != '' && ($_REQUEST['p'] == '0' || $_REQUEST['p']=="") ){ $Conictag = "http://".$_SERVER[HTTP_HOST].$CheckCanoNi[0]; echo '<link rel="canonical" href="'.$Conictag.'"/>'; } if($CheckCanoNi[1] != '' && $_REQUEST['reset'] == '1' && ($_REQUEST['p'] == '1' || $_REQUEST['p']=="")){ $Conictag = "http://".$_SERVER[HTTP_HOST].$CheckCanoNi[0]; echo '<link rel="canonical" href="'.$Conictag.'"/>'; } I'm trying to extend someone else's code that sets the canonical tags but please could someone break down what these if statements are doing please? I can't for the life of me seem to set the canonical tag on pages with query parameters. && $_REQUEST['reset'] == '1' [/size]seems to set the canonical tag on ?=reset URL's but it doesn't if I change the reset to perpage for example. Thanks in advance.
  11. I too, also have the same problem. Was trying to edit my contact information and don't yet have enough posts to access this area I believe. Thanks.
  12. Sorry, I forgot to mention that the other way I looked at was how you've suggested. You're right, $noescape serves no other purpose and what you're supplied is exactly what I was trying to do (just was unsure of the correct syntax but now looks so simple). Thanks very much
  13. This is the function I am currently working with... /** * Retrieve search query text * * @return string */ public function getQueryText() { if (!isset($this->_queryText)) { $this->_queryText = $this->_getRequest()->getParam($this->getQueryParamName()); $noescape = preg_replace("/%u([0-9a-f]{3,4})/i","\\1;",urldecode($this->_queryText)); if ($this->_queryText === null) { $this->_queryText = ''; } else { /* @var $stringHelper Mage_Core_Helper_String */ $stringHelper = Mage::helper('core/string'); $this->_queryText = is_array($this->_queryText) ? '' : $stringHelper->cleanString(trim($this->_queryText)); echo '<span style="display: none;">'; echo '<pre>'; var_dump ( $noescape ); echo '</pre>'; echo '</span>'; $maxQueryLength = $this->getMaxQueryLength(); if ($maxQueryLength !== '' && $stringHelper->strlen($this->_queryText) > $maxQueryLength) { $this->_queryText = $stringHelper->substr($this->_queryText, 0, $maxQueryLength); $this->_isMaxLength = true; } } } return $this->_queryText; } I can echo what I need to output in this function with $noescape however I need to modify return $this->_queryText; to include the preg_replace and rawurldecode from $noescape. Please could someone be kind enough to advise of the correct syntax/way of handling this? I did post this on StackOverflow but had no response as of yet. Thanks in advance.
  14. Hi there, sorry for the delayed reply. It's the sql related code in the php files which I have the problem with so wasn't sure which it would be classed as... Heh. Thanks
  15. Hi everyone, I am wanting to redevelop my social networking website from scratch due to continiously being let down by website design companies. A friend of mine started helping me with it a while back on my old domain. I am now wanting to carry on where he left off and tweak it and develop it from there. The only problem is, my php and mysql knowledge if pretty much non existent and I am eager to learn it as I go. Now I have got all php files and mysql database all over to the new domain and that is all done successfully. I am experiencing issues here and there though and was wondering if I was to show you parts of my code whether someone here might be able to help point me in the right direction to where the problems lie if thats possible...? I would be very grateful and dependant on how much someone could help, I would even be happy to pay them for their troubles as this is a massive project. Please let me know if this is ok before I start posting bits of code in this thread, I don't want to annoy any members and want to adhere to the forum rules. The first problem I have is my login script. I have all the tables set up in phpmyadmin and all the files on the server, the error code executed when you attempt to login is indeed the one that it is meant to display as per the code in the php file. I would imagine it would be simple to identify for one of you guys. Many thanks, I will await some responses. zigojacko (Geoff)
×
×
  • 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.