Guest User

Untitled

a guest
Feb 22nd, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 KB | None | 0 0
  1. jQuery.ajax(
  2. {
  3. url: formURL,
  4. type: "POST",
  5. data: {
  6. location : location,
  7. width : width
  8. },
  9. success: function() {
  10. alert('form good');
  11. },
  12. error: function() {
  13. alert('form issue');
  14. }
  15. });
  16.  
  17. class Custom_GateSelector_IndexController extends Mage_Core_Controller_Front_Action
  18. {
  19. public function indexAction()
  20. {
  21. $gate_location = $this->getRequest()->getPost('location');
  22. $gate_width = $this->getRequest()->getPost('width');
  23. }
  24. }
  25.  
  26. class Custom_GateSelector_Model_Products extends Mage_Catalog_Model_Product
  27. {
  28. public function getItemsCollection()
  29. {
  30. $topStairs = 'yes';
  31. $gateWidth = 29.00;
  32. $rootcatID = Mage::app()->getStore()->getRootCategoryId();
  33.  
  34. $collection = $this->getCollection()
  35. ->addAttributeToSelect('*')
  36. ->addAttributeToFilter('gate_max_width', array('gt' => $gateWidth))
  37. ->addAttributeToFilter('category_id', array('in' => $rootcatID))
  38. ->addAttributeToFilter('type_id', array('eq' => 'simple'))
  39. ->addAttributeToSort('price', 'DESC')
  40. ->addAttributeToFilter('status', array('eq' => Mage_Catalog_Model_Product_Status::STATUS_ENABLED));
  41.  
  42. return $collection;
  43. }
  44. }
  45.  
  46. public function getItemsCollection($gateLocation, $gateWidth)
  47. {
  48. // …
  49. }
  50.  
  51. $collection = $gsProduct->getItemsCollection();
  52. $collection->addAttributeToFilter('gate_max_width', array('gt' => $gateWidth))
  53.  
  54. $gate_location = Mage::app()->getRequest()->getPost('location');
  55. $gate_width = Mage::app()->getRequest()->getPost('width');
  56.  
  57. Mage::app()->getRequest()->getParam('location');
Add Comment
Please, Sign In to add comment