Jump to content

berthz

Members
  • Content count

    54
  • Joined

  • Last visited

Everything posted by berthz

  1. Support forum for: AJAX Image Attributes This contribution is based on the options as images contribution: (http://addons.oscommerce.com/info/1467) This contribution uses an AJAX script to load images linked with attibutes of a product. This way the drop-down list keeps functioning and the script loads the corresponding image onto the website. A working example can be found on: http://www.suitingyou.nl/nieuw/product_inf...p?products_id=8 Example pictures are included in the package. Reason for making this a brand new contrib rather then a new version of options as images is because the catalog side has completely changed and is not using any of the initial code anymore. Functions are basically the same: - Link images to attributes - Allow for an enlarged picture - Define width and height of pictures - Switch contrib on/off - AJAX loaded pictures on the product_info.php
  2. To use a lightbox: In ajaximage.php find: echo "<a href='" . tep_href_link(FILENAME_OPTIONS_IMAGES_POPUP, "oID=" . $id) ."' target='blank'><img src=./images/options/".$options['products_options_values_thumbnail']." height=".OPTIONS_IMAGES_HEIGHT." width=".OPTIONS_IMAGES_WIDTH."></a>"; and replace it by: echo "<a href='./images/options/".$options['products_options_values_thumbnail']." ' rel='lightbox'><img src=./images/options/".$options['products_options_values_thumbnail']." height=".OPTIONS_IMAGES_HEIGHT." width=".OPTIONS_IMAGES_WIDTH." border='0'></a>"; Obviously you must have the lightbox contrib installed.
  3. For some reason I dont get messages when there is a new post in this thread. Anyways today I had to update the contrib for one of my clients so that each attribute gets its own individual div and images of different attributes all show at the same time. To create a div for each individual attribute simply follow these steps (all in /catalog/product_info.php): find: <script language="javascript"> function createRequestObject() { var req; if(window.XMLHttpRequest){ req = new XMLHttpRequest(); } else if(window.ActiveXObject) { req = new ActiveXObject("Microsoft.XMLHTTP"); } else { req = NULL; alert('Probleem met het aanmaken van hetXMLHttpRequest object'); } return req; } var http = createRequestObject(); function sendRequestSearch(iets) { http.open('get', 'ajaximage.php?zoek='+iets); http.onreadystatechange = handleResponseSearch; http.send(null); } function handleResponseSearch() { if(http.readyState == 4 && http.status == 200){ if(http.responseText) { document.getElementById("zoek_resultaten").innerHTML = http.responseText; } else { document.getElementById("zoek_resultaten").innerHTML = " "; } } else { document.getElementById("zoek_resultaten").innerHTML = " "; } } </script> replace that by: <script language="javascript"> function createRequestObject() { var req; if(window.XMLHttpRequest){ req = new XMLHttpRequest(); } else if(window.ActiveXObject) { req = new ActiveXObject("Microsoft.XMLHTTP"); } else { req = NULL; alert('Probleem met het aanmaken van hetXMLHttpRequest object'); } return req; } <?php $opties = tep_db_query("select distinct products_options_id from " . TABLE_PRODUCTS_OPTIONS . ""); while ($optiesaantal = tep_db_fetch_array($opties)) { ?> var http<?php echo $optiesaantal['products_options_id']; ?> = createRequestObject(); function sendRequestSearch<?php echo $optiesaantal['products_options_id']; ?>(iets) { http<?php echo $optiesaantal['products_options_id']; ?>.open('get', 'ajaximage.php?zoek='+iets); http<?php echo $optiesaantal['products_options_id']; ?>.onreadystatechange = handleResponseSearch<?php echo $optiesaantal['products_options_id']; ?>; http<?php echo $optiesaantal['products_options_id']; ?>.send(null); } function handleResponseSearch<?php echo $optiesaantal['products_options_id']; ?>() { if(http<?php echo $optiesaantal['products_options_id']; ?>.readyState == 4 && http<?php echo $optiesaantal['products_options_id']; ?>.status == 200){ if(http<?php echo $optiesaantal['products_options_id']; ?>.responseText) { document.getElementById("zoek_resultaten<?php echo $optiesaantal['products_options_id']; ?>").innerHTML = http<?php echo $optiesaantal['products_options_id']; ?>.responseText; } else { document.getElementById("zoek_resultaten<?php echo $optiesaantal['products_options_id']; ?>").innerHTML = " "; } } else { document.getElementById("zoek_resultaten<?php echo $optiesaantal['products_options_id']; ?>").innerHTML = " "; } } <?php } ?> </script> find: <?php if (OPTIONS_AS_IMAGES_ENABLED == 'true'){ ?> <div id="zoek_resultaten"></div> <?php } else { } ?> Replace that by: <?php if (OPTIONS_AS_IMAGES_ENABLED == 'true'){ ?> <div id="zoek_resultaten<?php echo $products_options_name['products_options_id'];?>"></div> <?php } else { } ?> find: <td class="main"><?php echo tep_draw_pull_attribute_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute, 'onChange="sendRequestSearch(this.value);"'); ?></td> and replace that by: <td class="main"><?php echo tep_draw_pull_attribute_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute, 'onChange="sendRequestSearch'.$products_options_name['products_options_id'].'(this.value);"'); ?></td>
  4. berthz

    Customer Add Product

    Anyone searching for it. I have been working on the problem that on account_manage.php the preview and cancel button were not working but redirecting to the index page. It seems that the oscid is not requested on the start of the file which, after testing, seems nessecary for the links to work correctly. Therefore in account_manage.php: find: $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : ''); Directly after add: $osCsid = (isset($_REQUEST['osCsid']) ? $_REQUEST['osCsid'] : ''); Took me a while to figure out, so better post it here and save someone else hours of searching. :)
  5. berthz

    Quantity Price Breaks

    Well. Finally figured it out. For some reason the $qty was not calculated to the nearest products_qty_blocks in the adding to cart. Therefore I rewrote the script slightly. I already know it wasnt working because of another contribution because the contribution worked like a charm on a fresh installation but I have no idea which contribution caused this error. Anyone with the same problems try in includes/classes/shopping_cart.php to change: // BOF qpbpp if ($this->in_cart($products_id_string)) { $this->update_quantity($products_id_string, $qty, $attributes, $discount_category); } else { $this->contents[$products_id_string] = array('qty' => (int)$qty, 'discount_categories_id' => $discount_category); // EOF qpbpp into: // BOF qpbpp if ($this->in_cart($products_id_string)) { $this->update_quantity($products_id_string, $qty, $attributes, $product_info['discount_categories_id']); } else { // Berekening van aantal producten gaat niet goed zonder onderstaande code. Deze berekend de dichstbijzijnde minimale bundel afname bij het toevoegen van een product. Er word naar beneden afgerond. $min_order_query = tep_db_query("select p.products_qty_blocks as min_quant FROM " . TABLE_PRODUCTS . " p where p.products_id = '".$products_id_string."'"); while ($min_order = tep_db_fetch_array($min_order_query)) { if ($qty < $min_order['min_quant']) { $qty = $min_order['min_quant']; } if ($qty > $min_order['min_quant']) { $qty = ($qty - ($qty % $min_order['min_quant'])); } } $this->contents[$products_id_string] = array('qty' => (int)$qty, 'discount_categories_id' => $product_info['discount_categories_id']); // EOF qpbpp It will however round the final $qty down to the nearest products_qty_blocks rather then up. Math was not my best subject and I couldnt figure out how to do that.
  6. berthz

    Quantity Price Breaks

    I have been installing this contribution and it almost works. The problem is that when adding a product to the cart you can enter any quantity regardless of the minimum of the bundle. When I define the bundle to be 22 and I add a product entering 12 in the quantity box it will add 12 instead of the nearest bundle amount of 22. However when updating the product (when there already is a quantity in the cart) it works like a charm and calculates the correct amount including the bundle quantity. Anyone knows what the problem might be? I have been working on it for hours and it seems that the following line does not use the qpbpp qty of the product: $this->contents[$products_id_string] = array('qty' => (int)$qty, 'discount_categories_id' => $product_info['discount_categories_id']); This line, when updating the quanity of the cart does work: $this->update_quantity($products_id_string, $qty, $attributes, $product_info['discount_categories_id']); Help would be very much appreciated!
  7. One simple way of doing it is, in product_info.php change: <?php if (OPTIONS_AS_IMAGES_ENABLED == 'true'){ ?> <div id="zoek_resultaten"></div> <?php } else { } ?> to: <?php if (OPTIONS_AS_IMAGES_ENABLED == 'true'){ $options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_thumbnail from " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov order by pov.products_options_values_id"); $options = tep_db_fetch_array($options_query); ?> <div id="zoek_resultaten"><?php echo "<img src=./images/options/".$options['products_options_values_thumbnail']." height=".OPTIONS_IMAGES_HEIGHT." width=".OPTIONS_IMAGES_WIDTH.">"; ?></div> <?php } else { } ?> Quick fix, might need some work with initial selected image image corresponding with the initial selected option. However, it is tested and it works.
  8. Mahloha, You might be able to comebine sendRequestSearch and showPrice to have both function working. Otherwise try to make one of them an onfocus or onselect function. I dont know whether it works but its worth trying. GL.
  9. Danyeyi, It is possible to do something like that yes. You will have to modify the contribution to make the images larger and place them in some kind of div. Basically the contrib already does what you want it to do but you might have to tweak and modify the code slightly. Cant help you any further for now because the code already does what you want it to do. You might have to change the layout style slightly.
  10. It took me a while to fix it, but I have added a new file which fixes the problem you described. To have this working with QtPro is a good idea for further future development of this contrib.
  11. Melinda, Currently all the drop downs use the same name: "zoek". This could be an idea for the future to have all dropdown lists of the attributes use a different name for the options. That is the only way you can have multiple images of different attributes shown at the same times. I have added a new version of the AJAX image attributes which only shows images of attributes that are selected as options as images.
  12. berthz

    Quantity Price Breaks

    Hi! I love the contrib, it works like a charm! However, is there a way to show the customers that a discount has been given? And to have that message show in the shopping_cart.php? If possible a message stating per product if and how much discount has been given. Thanks in advance!
  13. berthz

    Manual Order Maker

    I have installed this contrib, which I am sure works great. However when clicking on the Create button I get the following error: Parse error: syntax error, unexpected T_REQUIRE in /home/sites/site4530/web/admin/create_order.php on line 5 Anyone knows what goes wrong here? Thanks in advance!
  14. berthz

    changing prices

    Hi Jim, No worries, something as simple as changing prices and deleting products shouldnt cost you a dime. In regard to your questions about the mail delivery notice I will have to see the error you receive when sending the e-mail to the customer. I do not know what the problem is with the description you gave. I do however have the feeling it is not an osCommerce problem but rather a email server problem. But I am not an expert on that. One thing you can also try is to log in to you admin and click 'Customers' there you will see a list of all your customers. Click on your own account and sent yourself an e-mail. See if that works, if so it might be an oscommerce problem after all. Greets, Bert
  15. berthz

    changing prices

    Hi Jim, You only have 6 products for as far as I can see. Chaning your prices is very easy. Also dropping the earrings and the shirts is very easy. A quick guide on how to do this: Log in to: you admin section You should have gotten those details from the designer, or in case you uploaded the oscommerce site yourself you most likely know the details. When logged in click on catalogue on the left side in the menu. When clicked you see the three categories you have on your website: Kona Coffee Wildmac T-Shirts Adria's Earrings Click Adria's Earrings. Then click on 'Delete' on the right side of your screen. Do the same with the Wildmac T-Shirts category. To change the prices of your Kona Coffee: Click on the Kona Coffee category. When you dont see your products yet click the category name again. When you see your products click on one and select "change" in the following screen change the price and click on "example" on the bottom of your screen. You will see the price is updated. Click on "update" to finalise the update of your price. Do this for all four of your products. If you have any questions you can email me
  16. berthz

    Official PayPal IPN Support Thread

    Hi! I have just installed PayPal IPN on a website I am working on (4memory.nl). However the thing is that I have enabled the module in the admin but it is not appearing/showing as a payment option when checking out. In the install file there is something about the sorting order, however I have given it a unique number. Uninstalling the normal PayPal module also does not work (clicking on deinstall in the modules). Anyone know what the problem might be? Thanks in advance!
  17. Hi all, I have just installed the STS 4.5.8 on my v2.2 RC1. The problem is that when I log into my admin section and try to install the default module of STS it wont activate. There are four options: Default - is not working when I click on "+ Install" Index - is working Popup image - is working Product info - is working. Anyone has any idea what this problem might be? I have already checked the install function in the sts_default.php, but that does not seem to be the problem. I have another website online with STS v 4.2 but that one works just fine... I am a little confused here. I might be able to manually activate the template by using phpmanager, however that is not very user friendly for my client. I really hope someone has an answer for me.
  18. berthz

    Activating STS default template

    Oke I got it working. The problem however is that I had to reinstal osCommerce completely. Also completely empty the database (delete all tables) and start a fresh installation... There must be a better way of solving this problem. Thanks!
×