Jump to content

Gabriel Crowe

Members
  • Posts

    10
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Gabriel Crowe's Achievements

Newbie

Newbie (1/14)

2

Reputation

  1. Hi everyone. I'm looking for a hook that I can use in a module that triggers when somebody adds more stock to their store. Hopefully i can get the SKU/reference of the item too. This is the value I need. I'm writing an API to connect to a new service i'm writing that lets presta people send email notifications to people who requested to be notified about new stock on items. The service is nearly complete, and i'm going around and writing plugins for the stores i'm familiar with first. The plugin so far looks great on a default store: Now the only missing part of my module, is automatically triggering notifications when the user of the store puts their stock into the backend. Can anybody help?
  2. it should be noted that even thought this puts an image in your rss for the web browser, using tweedfeed or whatever its called will not display the image, or a link to it. it'll put the html in the message. remove the image altogether if you intend to automatically tweet / wall this feed.
  3. <?php include(dirname(__FILE__).'/../../config/config.inc.php'); require_once(dirname(__FILE__).'/../../init.php'); // Get data $number = (intval(Tools::getValue('n')) ? intval(Tools::getValue('n')) : 10); $orderByValues = array(0 => 'name', 1 => 'price', 2 => 'date_add', 3 => 'date_upd', 4 => 'position'); $orderWayValues = array(0 => 'ASC', 1 => 'DESC'); $orderBy = Tools::strtolower(Tools::getValue('orderby', $orderByValues[intval(Configuration::get('PS_PRODUCTS_ORDER_BY'))])); $orderWay = Tools::strtoupper(Tools::getValue('orderway', $orderWayValues[intval(Configuration::get('PS_PRODUCTS_ORDER_WAY'))])); if (!in_array($orderBy, $orderByValues)) $orderBy = $orderByValues[0]; if (!in_array($orderWay, $orderWayValues)) $orderWay = $orderWayValues[0]; $id_category = (intval(Tools::getValue('id_category')) ? intval(Tools::getValue('id_category')) : 1); $products = Product::getProducts(intval($cookie->id_lang), 0, ($number > 10 ? 10 : $number), $orderBy, $orderWay, $id_category, true); $currency = new Currency(intval($cookie->id_currency)); $affiliate = (Tools::getValue('ac') ? '?ac='.intval(Tools::getValue('ac')) : ''); // Send feed header("Content-Type:text/xml; charset=utf-8"); echo '<?xml version="1.0" encoding="UTF-8"?>'."\n"; ?> <title><![CDATA[<?php echo Configuration::get('PS_SHOP_NAME') ?>]]></title> <link><?php echo _PS_BASE_URL_.__PS_BASE_URI__; ?></link> PrestaShop <?php echo Language::getIsoById(intval($cookie->id_lang)); ?> <title><![CDATA[<?php echo Configuration::get('PS_SHOP_NAME') ?>]]></title> <?php echo _PS_BASE_URL_.__PS_BASE_URI__.'img/logo.jpg'; ?> <link><?php echo _PS_BASE_URL_.__PS_BASE_URI__; ?></link> <?php $now = date("D, d M Y H:i:s O");?> <?php echo $now; ?> <?php foreach ($products AS $product) { $image = Image::getImages(intval($cookie->id_lang), $product['id_product']); echo "\t\t\n"; echo "\t\t".$product['reference']."\n"; echo "\t\t\t<title><![CDATA[".$product['name']." - ".html_entity_decode(Tools::displayPrice(Product::getPriceStatic($product['id_product']), $currency), ENT_COMPAT, 'UTF-8')." ]]></title>\n"; echo "\t\t\t<![CDATA["; if (is_array($image) AND sizeof($image)) echo "<img src=""._PS_BASE_URL_.__PS_BASE_URI__."img/p/".$image[0]['id_product']."-".$image[0]['id_image'].".jpg" title="".str_replace('&', '', $product['name'])."" alt="thumb" />"; echo "".$product['description_short']."]]>\n"; echo "\t\t\t<link><![CDATA[".htmlspecialchars($link->getproductLink($product['id_product'], $product['link_rewrite'], Category::getLinkRewrite(intval(Tools::getValue('id_category')), $cookie->id_lang))).$affiliate."]]></link>\n"; echo "\t\t\n"; } ?>
  4. take a look at the code. you'll notice a part like this: $image[0]['id_image']."-small.jpg i dont know enough about how presta works, but how about removing the "-small" part?
  5. I had a play with this, I had exactly the same problem as the OP. twitterfeed has an option to use GUID as the reference instead of the pubdate. I used the product reference instead. This code is from a fairly new version or presta, 1.3 i think. my feed validated fine too. Came up with a few errors on the validator, but worked fine in presta. This module NEEDS a re-write. Whoever wrote it, as previously mentioned, cut a lot of corners. Here is the code. <?php include(dirname(__FILE__).'/../../config/config.inc.php'); require_once(dirname(__FILE__).'/../../init.php'); // Get data $number = (intval(Tools::getValue('n')) ? intval(Tools::getValue('n')) : 10); $orderByValues = array(0 => 'name', 1 => 'price', 2 => 'date_add', 3 => 'date_upd', 4 => 'position'); $orderWayValues = array(0 => 'ASC', 1 => 'DESC'); $orderBy = Tools::strtolower(Tools::getValue('orderby', $orderByValues[intval(Configuration::get('PS_PRODUCTS_ORDER_BY'))])); $orderWay = Tools::strtoupper(Tools::getValue('orderway', $orderWayValues[intval(Configuration::get('PS_PRODUCTS_ORDER_WAY'))])); if (!in_array($orderBy, $orderByValues)) $orderBy = $orderByValues[0]; if (!in_array($orderWay, $orderWayValues)) $orderWay = $orderWayValues[0]; $id_category = (intval(Tools::getValue('id_category')) ? intval(Tools::getValue('id_category')) : 1); $products = Product::getProducts(intval($cookie->id_lang), 0, ($number > 10 ? 10 : $number), $orderBy, $orderWay, $id_category, true); $currency = new Currency(intval($cookie->id_currency)); $affiliate = (Tools::getValue('ac') ? '?ac='.intval(Tools::getValue('ac')) : ''); // Send feed header("Content-Type:text/xml; charset=utf-8"); echo '<?xml version="1.0" encoding="UTF-8"?>'."\n"; ?> <title><![CDATA[<?php echo Configuration::get('PS_SHOP_NAME') ?>]]></title> <link><?php echo _PS_BASE_URL_.__PS_BASE_URI__; ?></link> PrestaShop <?php echo Language::getIsoById(intval($cookie->id_lang)); ?> <title><![CDATA[<?php echo Configuration::get('PS_SHOP_NAME') ?>]]></title> <?php echo _PS_BASE_URL_.__PS_BASE_URI__.'img/logo.jpg'; ?> <link><?php echo _PS_BASE_URL_.__PS_BASE_URI__; ?></link> <?php $now = date("D, d M Y H:i:s O");?> <?php echo $now; ?> <?php foreach ($products AS $product) { $image = Image::getImages(intval($cookie->id_lang), $product['id_product']); echo "\t\t\n"; echo "\t\t".$product['reference']."\n"; echo "\t\t\t<title><![CDATA[".$product['name']." - ".html_entity_decode(Tools::displayPrice(Product::getPriceStatic($product['id_product']), $currency), ENT_COMPAT, 'UTF-8')." ]]></title>\n"; echo "\t\t\t<![CDATA["; if (is_array($image) AND sizeof($image)) echo "<img src=""._PS_BASE_URL_.__PS_BASE_URI__."img/p/".$image[0]['id_product']."-".$image[0]['id_image']."-small.jpg" title="".str_replace('&', '', $product['name'])."" alt="thumb" />"; echo "".$product['description_short']."]]>\n"; echo "\t\t\t<link><![CDATA[".htmlspecialchars($link->getproductLink($product['id_product'], $product['link_rewrite'], Category::getLinkRewrite(intval(Tools::getValue('id_category')), $cookie->id_lang))).$affiliate."]]></link>\n"; echo "\t\t\n"; } ?>
  6. I know I shouldn't, but i'd really like to bump this for somebody's opinion. *bump*
  7. Firstly let me say thanks for a great piece of software. Got me out of a few scrapes. I have a client that needs to sell spare parts. I have their database, and its 256,000+ spares for 5,000 items. In presta terms, thats quarter of a million products with more than 5k sections. i'll be using sections to represent the product, and products to represent the spares for that product with modified templates to tie it all together. I just did a test import and managed to get 68,000+ products in there before the importer crapped out. I noticed a little slowdown in the front end but nothing terrible, my test is running on a dedicated server. My question is, whats the maximum amount of products i can have before presta dies (before i waste my time faffing with it) and for developers out there, what can i do to make the whole thing faster. What features are the most costly with respect to product display and searches. Can i turn things off for more speed?
  8. after you paste the snippet into your product.tpl you'll find it creates a QRcode based on the products reference. you can right click on this and save it. print this on a sticker and put it on the shelves near the product. i had to do this for a few products. also, you can generate these codes for the url to your barcode scanner and stick them all over the place. this way, you can get new people to the scanner from wherever they are by merely scanning the code.
  9. The version posted above includes a simple search to find products without a barcode scanner. This means its compatible with the iPhone. I'm AWARE that it does not work with items containing drop down selectors. At this time, only single stock items are working. if you want to scan products off the webpage so you can assign a barcode to them, drop this snippet of code into your product.tpl: where XXXXXXXX = $product->reference surrounded by curly brackets (sorry, the forum mangled my code) http://www.interact-studio.co.uk/screencast/2010-07-13_1353.png The snippet will generate a QRcode on the product page that you can scan and use to assign stock. you can then associate the real items barcode and then use that barcode to scan the item from there on in.
  10. http://www.gabrielcrowe.co.uk/projects/scanner.zip unpack and upload this test to your server. you should be able to get to it at: http://www.mysitehere.com/scanner/ no config, NO SECURITY. Use at your own risk for TESTING only. Let me know how you get along.
  11. I was looking for a way to sort a big room of inventory items, armed with my phone, I created a way to manage inventory with a simple android device in prestashop. I have a HTC Hero, but there are people here with a 'Desire', and i had it working on a 'Magic'. Features: - Scan real barcodes with camera - Share with other phones via QR Code - No camera? Use the search - Update stock (Set number, increment, decrement) - View product name / description / stock in hand - Works on Android devices and iPhone (not tested) - Does not require Wi-Fi, can work over 3g, gprs, hsdpa Here's how it works: 1) Load the software, scan a QR Code with your product reference in it, phone displays stock info. 2) After Identification, you can associate a real barcode from the product packaging. This is inserted into prestashop's database. 3) You can now use the real barcode to identify the product. 4) When a product is identified, you can use the phone as an interface to adjust stock on your item remotely. The items stock is sent in real time to the online database. This works over wifi or mobile network (anywhere where there is phone signal). 5) Check your shop, your item is in stock and purchasable. The app uses QR codes heavily, and you can do clever things with it, like hold the phone up to another phone and scan the current item so you can 'pass it to a friend'. This lets you scan an item, take your phone out to the warehouse and let someone else scan your phone, so that theirs can be used to scan the barcode or adjust the stock. We printed out a big QR Code sheet that people can scan to access the software quickly, and a sheet like they have in the supermarket fresh department with loads of barcodes to scan things that are awkward and too big to go and find in the warehouse. I like this solution becasue lots of us here already have android type devices (it will work on any device with a camera, and the internet). Its NOT QUITE FINISHED YET and so I'm looking for some testers. To test this simple stock control scanner, contact me on: gabriel DOT crowe AT gmail DOT com I want to gauge how useful this is for people, and if i should turn it into a full blown finished app, or just drop it. Current issues: - Does not work with attributes. No sizes can be scanned. Only plain products. - Has issues with duplicate barcodes (Lazy companies that put a single barcoe onto multicoloured items for example) Attached are some pics to get you all excited:
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More