texts: js observe for field validation flickering

texts:
I am using this script:

<script type="text/javascript">
    $('street_1').observe('keyup', function(e){
        Validation.validate($('street_1'))
    });
</script>

Which on keyup triggers my form validation:

Validation.add('validate-jurgis', 'Address has to be no longer than 10 charecters', function (v, elm) {
    var reMax = new RegExp(/^maximum-length-[0-9]+$/);
    var reMin = new RegExp(/^minimum-length-[0-9]+$/);
    var result = true;
    $w(elm.className).each(function(name, index) {
        if (name.match(reMax) && result) {
            var length = name.split('-')[2];
            result = (v.length <= length);
        }
        if (name.match(reMin) && result && !Validation.get('IsEmpty').test(v)) {
            var length = name.split('-')[2];
            result = (v.length >= length);
        }
    });
    return result;
});

Everything works great, except the error message flickers once when the error message should pop-up and disappears, screen capture to show what I am talking about.

Screen capture

Edit

To make the problem clear, I made another screen capture (triggered on "@" character) (see from 6th second)

Screen capture 2


texts: Is there any observer like 'cataloginventory_stock_item_save_commit_after' in magento 2?

texts:
I need to trigger the inventory changes in Magento 2.0
I have an observer cataloginventory_stock_item_save_commit_after in Magento 1.9 and its working fine.

But I can't find the same observer in Magento 2 (or) is there any other method for triggering inventory changes in Magento-2 ?


texts: Magento 2.2.x How to get recently view product collection programmatically?

texts:
Here is code but not getting collection

namespace [Vendor]\RecentlyViewed\Block\Customer;

use \Magento\Catalog\Block\Product\Context;
use \Magento\Catalog\Model\Product\Visibility;
use \Magento\Customer\Model\Session as CustomerSession;
use \Magento\Reports\Block\Product\Viewed;
use \Magento\Reports\Model\Product\Index\Factory as IndexFactory;

class RecentlyViewed extends Viewed
{

    /**
     * @var \Magento\Customer\Model\Session
     */
    private $customerSession;

    /**
     * @param \Magento\Customer\Model\Session $customerSession
     * @param \Magento\Catalog\Block\Product\Context $context
     * @param \Magento\Catalog\Model\Product\Visibility $productVisibility
     * @param \Magento\Reports\Model\Product\Index\Factory $indexFactory
     * @param array $data
     */
    public function __construct
    (
        CustomerSession $customerSession,
        Context $context,
        Visibility $productVisibility,
        IndexFactory $indexFactory,
        array $data = [])
    {
        parent::__construct($context, $productVisibility, $indexFactory, $data);
        $this->customerSession = $customerSession;
    }

    /**
     * @return \Magento\Reports\Model\ResourceModel\Product\Index\Collection\AbstractCollection
     */
    public function getRecentlyViewedProducts()
    {
        $collection = $this->getItemsCollection();
    echo '<pre>';
    print_r($collection->getData());
    exit;
        return $collection;
    }

}


texts: Integrating tracking code into Magento success page

texts:
I am looking to integrate a tracking code onto the Magento checkout success page from a company called Paid On Results.

I've been trying to make the snippet of code from the following two pages: http://www.paidonresults.com/integration/advance-tracking.html

And: http://www.magebuzz.com/blog/implement-paidonresults-affiliate-tracking-code-for-magento/

I see that I add the code from the second page so that I can then put the information into the URL in the following bit of code:

So I know the merchant ID but as for the Sale ID and Purchases I'm not sure how to get these into the URL.

Any help is greatly appreciated.


texts: How does MageReport determine if patch 9767 is installed?

texts:
I've applied patch 9767 but for some reason, MageReport is saying it is not installed. Does anyone know the specifics of how MageReport determines if this patch is installed?

In my access logs, I can see an about 30 URLs are requested when MageReport runs the test.

Which of those URL are used to determine if the patch 9767 is installed?
What is the precise response they are looking to determine if the patch 9767 is installed? I have a hunch they are posting data and seeing if the form_key is required...
Are they parsing the responses and looking for specific strings? If so, what are they looking for?


texts: Magento 2 - Bestseller product collection

texts:
I am trying to get bestseller products on homepage using product collection in Magento 2.
I only got Most Viewed product listing (?) and I am not getting bestseller products.

Here is my code:

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$productCollection = $objectManager->create('Magento\Reports\Model\ResourceModel\Product\CollectionFactory');
$collection = $productCollection->create()
          ->addAttributeToSelect('*')
          ->addAttributeToFilter('status','1')
          ->setPageSize(8)
          ->load();

Can someone tell me which ResourceModel I need to load? I tried with:

Magento\Sales\Model\ResourceModel\Report\Bestsellers\CollectionFactory`enter code here`

But didn't helped (I got some error with that code and that resource).


texts: Sell Bundle at discount price, sell individual products in bundle at full price

texts:
I have a product bundle (for example skateboard), when all products in bundle are selected it will display a discount price. If a buyer wants to purchase just part of the bundle (for example just the wheels) they can buy that product at full price.
Can such an option be possible? If so how to configure it in the admin panel.


texts: Magento 2: How can I Revoke an Authorization Token

texts:
Per the Magento 2 developer documentation

  When you make web API calls, you supply this token in the Authorization request header with the Bearer HTTP authorization scheme to prove your identity. The token never expires but it can be revoked.

As a system owner -- how do I revoke an authorization token?  Is it as simple as setting the revoked column in the oauth_token to 1?  Or do I need to do more.

Irrespective of that, is there a GUI for doing this anywhere?  Or do I need to manually edit the database myself?


texts: Root folder structure different depending on where you download

texts:
I'm brand new to Magento and I have gone straight to M2. I had some initial issues getting M2 up and running and worked through a number of different solutions. What I have noticed is that depending on where/how you download M2 the root folder structure is different. e.g. If you pull from GitHub the app folder is:
root/app/code, design, etc, i18n (which is what I expect according to the training videos).
However if you download M2 with Sample Data (yoga shop) the structure is:
root/app/design, etc
The code folder is in
root/update/app/code

I have also tried downloading some other themes and the code folder seems to also be in the 'update' folder.

Can someone please help to clear this up as I have created a module and it works fine the GitHub version but I don't know where to put it in the other versions, I'm assuming the Vendor folder but 'ass-u-me' is not good!

Thanks


texts: Magento new website/store products links 404 error

texts:
i have setup new website and store for international customers in magento and published all the products to new website and re-index every thing ,now when i click on any products in new store i get 404 error.

store for local market :         ayurvedacart.in
store for International market : ayurvedacart.in/outside (products link having 404 error)

i am confused whats wrong?


texts:
I have created a custom controller to create customer using try catch,

below is my magento1 code of controller

How this can be used in magento2?

  try {
      $user = Mage::getModel('customer/customer')->setId(null);
      $data = $this->getRequest()->getPost();

        $defaultFields = array();
        foreach (Mage::getConfig()->getFieldset('customer_account') as $code=>$node) {
            $defaultFields[] = $code;
            if ($node->is('create') && isset($data[$code])) {
                if ($code == 'email') {
                    $data[$code] = trim($data[$code]);
                }
                $user->setData($code, $data[$code]);
            }
        }
      $user->save();
  }
  catch (Mage_Core_Exception $e) {
            $this->_getSession()->setCustomerFormData($this->getRequest()->getPost());
            if ($e->getCode() === Mage_Customer_Model_Customer::EXCEPTION_EMAIL_EXISTS) {
                $url = Mage::getUrl('customer/account/forgotpassword');
                $message = $this->__('There is already an account with this emails address. If you are sure that it is your email address, click here to get the password and access your account.', $url);
                $this->_getSession()->setEscapeMessages(false);
            }
            else {
                $message = $e->getMessage();
            }
            $this->_getSession()->addError($message);
        }
        catch (Exception $e) {
            $this->_getSession()->setCustomerFormData($this->getRequest()->getPost())
                ->addException($e, $this->__('Can\'t save user'));
        }

Below code i used on m2

class CreatePost extends \Magento\Framework\App\Action\Action
{
protected $_customerSession;
protected $customerFactory;
protected $_objectManager;
protected $_messageManager;
public function __construct(
    \Magento\Framework\App\Action\Context $context,
    \Magento\Customer\Model\Session $customerSession,
    \Magento\Customer\Model\CustomerFactory $customerFactory,
    \Magento\Framework\ObjectManagerInterface $objectmanager,
    \Magento\Framework\Message\ManagerInterface $messageManager,
) {
    $this->_fieldsetConfig = $fieldsetConfig;
    $this->_customerSession = $customerSession;
    $this->customerFactory  = $customerFactory;
    $this->_objectManager = $objectmanager;
    $this->_messageManager = $messageManager;
    parent::__construct($context);
}
  if ($this->getRequest()->isPost()) {
  $data = $this->getRequest()->getPost();
        $defaultFields = array();
        $customerAccount = $this->_fieldsetConfig->getFieldset('customer_account');
        foreach ($customerAccount as $code=>$node) {
            $defaultFields[] = $code;
            if ((isset($node['create'])) && (isset($data[$code]))) {
                if ($code == 'email') {
                    $data[$code] = trim($data[$code]);
                }
                $user->setData($code, $data[$code]);

            }
        }
try {
            $user->save();
            $this->_messageManager->addSuccess(__('User was successfully created.'));
            return $this->_redirect('*/*/listuser/');

        }catch (\Exception $e){
           $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e->getMessage());
           $this->_messageManager->addError(__('We were unable to submit your request. Please try again!'));
           return $this->_redirect('*/*/listuser/');
        }
 }

Please anyone help me on this how try catch is used for above code in magento2 format?


texts:
Have some problem with default menu on my testing and practice local host. Here is the problem created few just test subcategories and they are not shown at all in case nothing is shown. For this I also create another localhost with sample data and when I created just some page with nothing and add it as subcategory everything went fine page is displayed and link is working fine.

My question is do I need to create all to be root categories or I need to edit some lines in maybe local.xml?


texts: Set Discount Price on Product detail page

texts:
I am developing a module where I need to set discounted price for a product if applicable. Admin will set a discount percent from backedn for a product and based on that the product price will be calculated.
For ex:
Product Price = 299
Discount Percent = 20%
Discounted Price = 239.20

So the price for that product will be 239.20. I have displayed the discounted price successfully on listing page and the file changes is
catalog/product/list.phtml

But now I also need to change the price on product detail page. The file being used to display the price is
catalog/product/price.phtml

I do not want to change the .phtml file as it has number of conditions for price display.

What is the best method to set the discounted price on product detail page ?
I hope my question is clear.
Please Help.
Thanks


texts: Magento 2 can we have separate urls for each store

texts: As when I need to create a separate store as each store should have separate URLs in magento2.1.7


texts: Admin URL showing 404 Not found in Magento2.2.6

texts:
I have installed fresh Magento2.2.6.

When I open its admin URL using

  http://127.0.0.1/magento226/admin

or

  http://127.0.0.1/magento226/index.php/admin,

it is redirected to

  http://127.0.0.1/magento226/admin/admin/index/index/key/79f05d66e460a56c70ff504e6f04c512a60322a973ddf048899336fc64d9f9f1/

What's wrong there ?


texts: Magento 2: Setting up mini cart loader overlay

texts:
How can I create the mini cart loader overlay when customer deleting an item?

I've found js files but I can't figure out where should I put code lines to activate and disable loader overlay.

Thank you in advance!


texts: The shipping information was unable to be saved. Verify the input data and try again i ma getting this error in checkout page magento 2.3


texts: How to add Date using dynamic field in system.xml file?

texts:
I want to add Date control in system.xml file using dynamic field...
as shown in below image

Does anyone have any idea? How can I do this?
Thanks in Advance :)


texts:
i am trying to display most viewed products on homepage. getting following error.

class Mage_Catalog_Block_Product_Mostviewed extends Mage_Catalog_Block_Product_Abstract {
public
function __construct() {
    parent::__construct();
    $storeId = Mage::app() - > getStore() - > getId();
    $products = Mage::getResourceModel('reports/product_collection') - > addOrderedQty() - > addAttributeToSelect('*') - > addAttributeToSelect(array('name', 'price', 'small_image')) - > setStoreId($storeId) - > addStoreFilter($storeId) - > addViewsCount();
    Mage::getSingleton('catalog/product_status') - > addVisibleFilterToCollection($products);
    Mage::getSingleton('catalog/product_visibility') - > addVisibleInCatalogFilterToCollection($products);
    $products - > setPageSize(5) - > setCurPage(1);
    $this - > setProductCollection($products);
}

}

Fatal error: Class 'Mage_Catalog_Block_Product_Mostviewed' not found in  C:\xampp\htdocs\ifasonx\app\code\core\Mage\Core\Model\Layout.php on line 491

refference:- http://www.magikcommerce.com/blog/how-to-show-most-viewed-best-selling-products-in-magento-store/


texts: Magento site in between getting disconnected , becomes slow.. Why?

texts: Actually my site has so many api's like betaout, flipkart, amazon and so on. Now it has become very big site. I want to increase site speed as well as want to know the reason why it is gettting disconnected and becomes slow.


texts:
After installing Magento 2 with sample data I'm getting below error:

main.CRITICAL: Default website is not defined {
"exception":"[object] (DomainException(code: 0): Default website
             is not defined at magento2\\vendor\\magento\\module-store\\Model\\WebsiteRepository.php:144)"
}


texts: Keeping Magento Database, Using Fresh Files

texts:
I have Magento CE 1.9.2.1. The database is just fine, but the files are messed up. I'd like to keep the database and just replace the files and start designing from scratch. Is this possible? If so, how could I go about doing this?

I know I'd have to keep the 'media' folder to keep my product images. Anything else I would need to worry about?


texts: Modify price of all product using event observer

texts:
I made module to add 100 USD to all products price using module, but it does not work as expected. Need help to fix it.

Below is my event observer xml code:

<catalog_product_collection_load_after>
            <observers>
                <setname>
                    <type>model</type>
                    <class>Mdoule_Customgroup_Model_Observer</class>
                    <method>modifyall</method>
                </setname>
            </observers>
</catalog_product_collection_load_after>

and modifyall function is as below:

    public function modifyall(Varien_Event_Observer $observer) {
        $products = $observer->getCollection();
        foreach( $products as $product )
        {
            $originalprice = $product->getPrice();
            $customprice = $originalprice+ 100;
            $product->setPrice($customprice);
            $product->setCustomPrice($customprice);
            $product->setOriginalCustomPrice($customprice);
        }
   }

that works fine but i get price like below:

$1,450 $1,550


texts:
I wanna install some patches for my magento 1.9.3.3, but i didn't find SUPEE-9767 in https://magento.com/tech-resources/download

What can i do?


texts: config products out of stock option controlling

texts:
I have one doubt magento below are the my question

Configurable Product

Manage Stock => Yes; Use Config Settings
Stock Availability => In Stock
Simple Product 1

Manage Stock => Yes; Use Config Settings
Stock Availability => Out of Stock
Quantity => 0
Simple Product 2

Manage Stock => Yes; Use Config Settings
Stock Availability => Out of Stock
Quantity => 1
Simple Product 3

Manage Stock => Yes; Use Config Settings
Stock Availability => Out of Stock
Quantity => 0

all simple products are out of stock.

but config product showing instock. it can't update dynamically when associated products are out of stock.

all simple products are out of stock.

but config product showing in stock. it can't update dynamically when associated products are out of stock.


texts: How get a static block content based on its title not identifier?

texts:
I wanted to get in product page a sizing chart. I could do that very easy but I want to improve and need some help. So, I created a drop down attribute called size_chart with the following values which identify my static blocks:

addidas_shoes
puma_shoes
nike_shoes

Choosing an option from the list I can get the right static block. Now I would like to change the drop down values to block titles instead of block id's for a better visual improvement, like this:

Adidas Shoes
Puma Shoes
Nike Shoes

How can I get inside my phtml template the block content based on its title instead of its identifier? Is this possible?


texts: Click on 2nd level Submenu Close All Menu in Mobile(View) in Magento 2

texts:
When i click on 2nd level menu in mobile it collapse all active menu. I tested this on default theme also. it also happening there. I think its default issue.

How can i prevent it to stop collapse all menu and only collapse current menu?


texts: Shopping cart ajax quantity display wrong when changing so fast.

texts:
I'm working with ajax in shopping cart magento. Here is my website: http://sites.magebuzz.com/wholesalersdirect/checkout/cart/.

When I change the quantity of each item by clicking on up or down button, I use ajax to update price, subtotal ... but when I clicking so fast, it will display wrong. So anyone can help me ?


texts: Product gets removed from mini-cart even if I click "Cancel" on confirm pop-up

texts:
When I click to remove product from mini-cart a confirm dialog pops up with "Cancel" or "Ok", if I click on "Cancel" the product still gets removed.

Any idea why and how to fix it?

This is the a element to remove product from mini-cart:

Remove This Item

No errors in console, tried adding custom jquery function, adding preventDefault, but nothing. Even just adding onclick="return false;" doesn't do anything.

I did a small test and added onclick="return false;" to different elements like buttons and links in different templates, but the buttons and links still work after clicking on them. Any idea what could be wrong?

Magento 1.9.0.1


texts: How can I bypass _validateFormKey securely?

texts:
I am allowing WordPress to load Magento widgets by overriding Mage_Widget_Adminhtml_Widgetcontroller as shown below. I'm ensuring that a user is logged in as admin, but am I opening up myself to security issues?

/**
 * Widgets management controller
 *
 * @category    Mage
 * @package     Mage_Widget
 * @author      Magento Core Team <core@magentocommerce.com>
 */
require_once("app/code/core/Mage/Widget/controllers/Adminhtml/WidgetController.php");

class Etre_WordPress_Adminhtml_WidgetController extends Mage_Widget_Adminhtml_WidgetController
{

    /**
     * Validate Form Key
     *
     * @return bool
     */
    protected function _validateFormKey()
    {
        if ($this->_isWordPressRequestAndLoggedIn()) return true;
        return parent::_validateFormKey();
    }

    /**
     * Validate Secret Key
     *
     * @return bool
     */
    protected function _validateSecretKey()
    {
        if ($this->_isWordPressRequestAndLoggedIn()) return true;
        return parent::_validateSecretKey();
    }

    protected function _isWordPressRequestAndLoggedIn()
    {
        /* We're note verifying _wpnonce with WordPress, so we can't be sure that
          the request is actually coming from WordPress. But it is a start. */
        if ($this->getRequest()->getParam('isAjax', true) && $this->getRequest()->getParam('_wpnonce', true) && Mage::getSingleton('admin/session')->isLoggedIn()):
            return true;
        elseif ($this->getRequest()->getParam('isAjax', true) && $this->getRequest()->getParam('_wpnonce', true)):
            /*The request is likely coming from wordpress but the admin is not logged in */
            Mage::getSingleton("admin/session")->addError($this->__("You must be logged into Magento to perform this action."));
            return false;
        endif;
    }
}


texts:
What is the functionality of additional_attributes from catalog & how it's work?

catalog->etc->wsdl.xml

<complexType name="catalogProductReturnEntity">
                <all>
                    <element name="additional_attributes" type="typens:associativeArray" minOccurs="0"/>
                </all>
            </complexType>

 <message name="catalogProductInfoResponse">
        <part name="info" type="typens:catalogProductReturnEntity"/>
    </message>

Can you please explain briefly if it possible give me a example?

Thanks.


texts: magento 2 how can we send shipment and invoice pdf attachment in one email

texts: i want to attach invoice pdf with shipment email so how can we attach invoice pdf in shipment email as i am using magento 2 mageplaza pdfinvoice module. it attach only one pdf at one time.


texts: How to get form data to controller in Magento 2?

texts:
I have created a custom module in which I have created a form like this

    <form action="<?php echo $this->getUrl('AdminSample/sampleOne/index');?>" method="post" enctype="multipart/form-data">

    View 1:
        <input data-form-part="product_form" type="file" name="fileToUpload1" id="fileToUpload" required >

    View 2:
        <input data-form-part="product_form" type="file" name="fileToUpload2" id="fileToUpload" required>

    View 3:
        <input data-form-part="product_form" type="file" name="fileToUpload3" id="fileToUpload" required>

    View 4:
        <input data-form-part="product_form" type="file" name="fileToUpload4" id="fileToUpload" required>

    View 5:
        <input data-form-part="product_form" type="file" name="fileToUpload5" id="fileToUpload" required>

    View 6:
        <input data-form-part="product_form" type="file" name="fileToUpload6" id="fileToUpload" required>

    View 7:
        <input data-form-part="product_form" type="file" name="fileToUpload7" id="fileToUpload" required>

    View 8:
        <input data-form-part="product_form" type="file" name="fileToUpload8" id="fileToUpload" required>

    View 9:
        <input data-form-part="product_form" type="file" name="fileToUpload9" id="fileToUpload" required>

    View 10:
        <input data-form-part="product_form" type="file" name="fileToUpload10" id="fileToUpload" required>

    View 11:
        <input data-form-part="product_form" type="file" name="fileToUpload11" id="fileToUpload" required>

    View 12:
        <input data-form-part="product_form" type="file" name="fileToUpload12" id="fileToUpload" required>

Parts & Colors

    <input type="button" onclick="addTable()" value="Add Part">

<button type="submit">Save</button>
</form>

and i have called custom controller, but i'm getting redirect to admin dashboard. Is there anything wrong in this code?
Please help me to get all images descriptions like name, tmp_name, size and type?

Please ask, If any additional information required to anyone.

This is custom controller i write

<?php
namespace Tym17\AdminSample\Controller\Adminhtml\SampleOne;

class Index extends \Magento\Backend\App\Action
{
  /**
  * Index Action*
  * @return void
  */

    protected $resultRawFactory;

        public function __construct(\Magento\Backend\App\Action\Context $context) {
             parent::__construct($context);
        }
  public function execute()
  {

    echo "one";
    print_r($_POST);die;
  }
}


texts: Magento : How can merge payment and shipping method steps to checkout

texts:
I want display payment method and shipping method on one single step on checkout page.

I have merged billing and shipping address steps in single step.


texts: How to hide product price for entire website in magento2

texts:
I have used the below code its not working.

di.xml file:

< config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    < type name="Magento\Catalog\Pricing\Render\FinalPriceBox">
        < plugin name="customization_finalpricebox" type="Checkout\Customization\Plugin\FinalPriceBox"/>
    < /type>
< /config>

Plugin file code:
FinalPriceBox.php

namespace Checkout\Customization\Plugin;

class FinalPriceBox
{
function aroundToHtml($subject, callable $proceed)
{

    if($subject->getSaleableItem()->getHidePrice()==1){
        return '';
    }else{
        return $proceed();
    }

}

}


texts: Magento2: How can update & create the CMS static Page programmatically

texts: How can update an existing CMS static Page and how to create a new CMS static Page - programmatically


texts: Magento 2 : Security Check Can Not be Verified!

texts:
I use magento 2.2.2. I try to have a security check provided by Magento at
https://account.magento.com/scanner/index/form/
I add confirmation code, I check it in source of my site, but when I try to verify my site, I do not get it verified!
Anyboady can help me why?
I made a film too. please, look at this film
http://recordit.co/r1mii3v58B
Regards


texts: Understanding Catalog URL Rewrite Indexer

texts:
I've truncated the core_url_rewrite table with about 5000000 records. After that I run the Catalog URL Rewrite Indexer which created 1782612 records. Then I run it again and the table had 2251930 records. So, every time I run the indexer, I get more records in the table. Does anyone know why?
Thanks


texts: How to program with the Object manager through PHPStorm Magento 2

texts:
I'm fairly new to the programming part of Magento 2, I've been using rest calls with PHP, but I want to change method as I'm opening up a second shop. Now I would like to know if it is possible to somehow "integrate" my Magento 2 directory within PHPStorm. And when that is done, where can i find a good guide to how to start using the Object manager to programmatically do CRUD operations in Magento 2? I found the documentation of Magento 2 confusing, and don't know where to start or even how to access the object manager. When i search on the internet I found dozens of documentation for Magento 1 using the "Mage::" but that isn't available anymore, so I don't know where to start!

EDIT : I'm programming on my laptop, and Magento 2 dir is on a dedicated server, that I can acces trough SSH or SFTP.

Thanks!


texts: use static block to add banner underneath nav bar but only on category pages

texts:
I want to add a banner directly underneath the nav bar but I only want it to display on category pages, I have added a static block in cms and I have had it display on all pages via using the header.phtml file (and just putting it at the end of the file) but I only want to to display on category pages so I can't use the header.phtml file as that is called on all pages and there is no category template that I can call it in that will display it where I want it. I have tried adding:

<block type="cms/block" name="top_images">
    <action method="setBlockId"><block_id>top_images</block_id></action> </block>

into catalog.xml (in the layout folder of my theme) but that doesn't seem to show up.

Any suggestions?


texts: Fatal Error after instaling a new domain

texts:
My new domain that I install on the server can not connect to the browser, but the way that I use the same process to install a previous domain.

The results that appear in my browser are:

  Fatal error: Call to undefined function mysqli_connect() in
  /home/localhost/public_html/settings.php on line 12

Please give me solution to solve this problem

Thanks.


texts: Join only returning one row in getLoadSelect method rewrite

texts:
I'm trying to load all of the associated entries to another table that has a foreign key

protected function _getLoadSelect($field, $value, $object)
{
    $field = $this->getConnection()->quoteIdentifier(sprintf('%s.%s', $this->getMainTable(), $field));

    $select = $this->getConnection()->select()->from($this->getMainTable())->where($field . '=?', $value)
    ->join(
        ['second_table_alias' => 'second_table'],
        'first_table.entity_id = second_table_alias.entity_id'
    )
    ->group('second_table_alias.entity_id');

    return $select;
}

There are multiple rows that share that entity_id and if I switch between left join and join (inner join) it returns different results.

Is it possible to get an array of all rows with that entity_id from the secondary table? What am I doing wrong?


texts: Magento 2: Mix & Match Product with Buy More Get Discount

texts:
I have 10 different simple products.

If a customer buys any of 2 (among 10) then it will be 5$ price discount.
If a customer buys any of 3 (among 10) then it will be 10$ price discount.

So among 10 products on basis of Quantity user gets the discount.

Tier pricing is only used for that product. But I have to do same for X products.


texts: Custom payment method like purchase order

texts:
i want to add my custom payment method say purchase order just clone of Payment Methods > purchase order ,
means clone of purchase order with different name of how can i add two purchase order , please guide me way to do this .

how can i make purchase order module i am newbie in magento , pls tell if there already ready made link for that .
or how can i do it via module


texts: Magento 2: How to set minimum amount option by default in product detail page for configurable options?

texts:
I want to auto select the lowest price options in product details page for configurable product in magento 2.

Tried to set the value using Jquery in product detail page.its not worked out.

Willing to get a method configurable.js file.


texts: Get product information in admin controller using the order id?

texts:
I want to get the product information like product id, sku at admin(backend), When action is being performed on any order. How can I achieve this.

This is code:

<?php

namespace Custom\Confirm\Controller\Adminhtml\Order;

use Magento\Framework\Controller\ResultFactory;
use Magento\Backend\App\Action\Context;
use Magento\Ui\Component\MassAction\Filter;
use Custom\Confirm\Model\ResourceModel\Saleslist\CollectionFactory;

/**
 * Class Payseller.
 */
class MassConfirm extends \Magento\Backend\App\Action
{
     /**
     * @var \Magento\Sales\Api\OrderRepositoryInterface
     */
    protected $_orderRepository;

    /**
     * @var \Magento\Sales\Model\Service\InvoiceService
     */
    protected $_invoiceService;

    /**
     * @var \Magento\Framework\DB\Transaction
     */
    protected $_transaction;

    protected $_order;

    public function __construct(
        \Magento\Framework\App\Action\Context $context,
        \Magento\Sales\Api\OrderRepositoryInterface $orderRepository,
        \Magento\Sales\Model\Service\InvoiceService $invoiceService,
        \Magento\Sales\Model\Order $orderInfo,
        \Magento\Framework\DB\Transaction $transaction
    ) {
        $this->_orderRepository = $orderRepository;
        $this->_order = $orderInfo;
        $this->_invoiceService = $invoiceService;
        $this->_transaction = $transaction;
        parent::__construct($context);
    }

    /**
     * Execute action.
     *
     * @return \Magento\Backend\Model\View\Result\Redirect
     *
     * @throws \Magento\Framework\Exception\LocalizedException|\Exception
     */
    public function execute()
    {
            /** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
        $resultRedirect = $this->resultRedirectFactory->create();

        $wholedata = $this->getRequest()->getPost();

        foreach ($wholedata['selected'] as $orderId){

         $order = $this->_orderRepository->get($orderId);

                $order2=$this->_order->load($orderId);
                $items = $order2->getAllItems();
                echo $orderId;
                //var_dump($items);
                foreach($items as $i){
                 //var_dump($i);
                 // code to retrieve product id
                }

                  $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
                $order_ = $objectManager->create('\Magento\Sales\Model\Order')
                                           ->load($orderId);

                $order_->setState("processing")->setStatus("processing");

                $order_->save();

        }
        $this->messageManager->addSuccess(__('The order has been confirm. '));
        return $resultRedirect->setPath('sales/order/index');
    }

}

Thanks in advance.


texts: Magento 1.9.2. - Validate email if already exist with ajax without custom module

texts:
Before registering I would like to validate the email field entered by the user to know if it exists in the database.

This is my code:
<input type="text" name="emailreg" value="" id="emailPreReg" class="input-text required-entry validate-email" title="" />

<button class="button2" id="btm-procedi"><?php echo $this->__('Proceed'); ?></button>

I would like the email field when the user clicks on button to have a check if email already exists in the database. In this case I would like to put an error message in the display block under the email input field.

My question is: Can i do this validation with Ajax/jQuery without custom modules?

Thanks for any help


texts: How Can I Change Dimension Of Gallery Thumbnail Image Product Detail In Magento 2?

texts:
I Need Make That Image Small.

How Can I Change Dimension Of Gallery Thumbnail Image Product Detail
In Magento 2

That's Gallery Thumbnail Image Need Small It Any One Help Me.


texts:
I'm building a query to extract a report of products and relative authors.
For Each SKU I can select n authors, authors attribute ID is 151.
This query returns comma separated values for ed.value field (IdAuthors) but decode only the first one in edv.value (Author Label)
    SELECT p.sku, p.attribute_set_id, ed.value as IdAuthor, edv.value as Author
FROM catalog_product_entity as p
LEFT JOIN (
    select * FROM `ines_m2prod`.`eav_attribute_set`
) at ON p.attribute_set_id = at.attribute_set_id
LEFT JOIN (
SELECT * FROM `catalog_product_entity_varchar` where attribute_id = 151
) ed on p.entity_id = ed.entity_id
LEFT JOIN (
SELECT * FROM `eav_attribute_option_value`
) edv on ed.value = edv.option_id
where ed.value is not null

Where I'm wrong?


texts: How to Enable/Disable Magento 2 Developer Mode?

texts:
How can I hide errors from the main site?
My developer mode is off.
PHP bin/magento maintenance:disable.
What can I do? My site is not working.
By mistake, I run the command.
php bin/magento deploy:mode:set developer
Now it is showing an error, and the overall site is not working.


texts: Can we change the already created sytem configuration text field to text area?

texts: In magento 2.3,is this possible to change the text field value in system congiguration to text area ...for example I have created the field test of type text but now I need test field with textarea type


texts: Limit cart to products only from the same category

texts: Could it be possible to throw an exception flag if a user tried to add products that are not in the same category as the items already in their cart?  Much the same way that Magento throws a flag if a user tries to add both a Nominal and Regular product to the same cart.


texts: Magento 2 get product details in product review list phtml?

texts:
How can I get product details like product type and name in particular product reviews list page.

Actually I want to Display "Product-Name reviews" Instead of "Customer Reviews" in product detail page.

Any help would be appreciated, Thanks.


texts:
Our request is to have quantities on configurable products, based on total quantity of simple associated products. With this d we will be able to filter configurable products by quantity admin panel.
Can't Update Stock Quantity on Simple Product based Configurable Product in Magento Admin panel

please check screen short and thanks advance for your help.


texts: Magento product details page add multi select checkbox filter

texts:
I want to add a multi select check box filter to my product details page.

1: I created an attribute (multi select attibute)
2: Marked category as anchor

Now I can see filter as a link. I want multi select checkbox there. How can it be done. Is there any setting in admin for that ?

sample url : http://goo.gl/TKf9uQ

See color filter there , I want multi select there .


texts:
I have just installed & when we try to go to admin after entering username & password it remains on same screen

Thanks


texts: Magento 1 remove Disallow: /tag/ in robot.txt

texts:
My robots.txt contain any code and this code
Disallow: /tag/
Is it okay for SEO to delete this command?


texts:
I am created custom module in magento 2, but it's not working. Could you please suggest me where i went wrong?

my Code is:

app/etc/config.php

'modules' =>
  array (
    'Magento_Hello' => 1,
         ),

app/code/local/Magento/Hello/etc/module.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
    <module name="Magento_Hello" schema_version="2.0.0">
        <sequence>
            <module name="Magento_Hello"/>
        </sequence>
    </module>
</config>

app/code/local/Magento/Hello/etc/frontend/routes.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd">
    <router id="standard">
        <route id="hello" frontName="hello">
            <module name="Magento_Hello" />
        </route>
    </router>
</config>

app/code/local/Magento/Hello/Controller/Index/Index.php

<?php
namespace Magento\Hello\Controller\Index;
class Index extends \Magento\Framework\App\Action\Action
{
    public function execute()
    {
        $this->_view->loadLayout();
        $this->_view->getLayout()->initMessages();
        $this->_view->renderLayout();
    }
}

app/code/local/Magento/Hello/Block/Hello.php

<?php
namespace Magento\Hello\Block;
class Hello extends \Magento\Framework\View\Element\Template
{
    public function _prepareLayout()
    {
        return parent::_prepareLayout();
    }
}

app/code/local/Magento/etc/frontend/layout/hello_index_index.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
   <head>
       <title>Hello World</title>
   </head>
    <body>
        <referenceContainer name="content">
            <block class="Magento\Hello\Block\Hello" name="hello" template="success.phtml">
            </block>
        </referenceContainer>
    </body>
</page>

app/code/local/Magento/etc/frontend/templates/success.phtml

<?php echo 'Hi I am Magento 2'; ?>

Where I went wrong?

Thanks in advance.


texts:
I want create login functionality outside magento, but same server.
For this I created a login form, but without correct form key it is useless.

Is there way to get customer login form key?

Here is my code. But it gives different key

<?php
require 'store/app/Mage.php';
Mage::app();
// Define the path to the root of Magento installation.
define('ROOT', Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB));

// Obtain the general session and search for an item called 'customer_id'
$coreSession = Mage::getSingleton('core/session', array('name' => 'frontend'));

$key = Mage::getSingleton('core/session')->getFormKey();
?>

<form action="mydomain/store/customer/account/loginPost/" method="post">
    <input name="form_key" value="<?php echo $key; ?>" type="hidden">
    <input type="text" name="login[username]" value="username" />
    <input type="password" name="login[password]" value="password" />
    <input type="submit" name="submit" value="submit" />
</form>

Edit

My Problem is $this->getBlockHtml('formkey'); and Mage::getSingleton('core/session')->getFormKey() not same is there any way  to use real form key.


texts: Filter manufacturer and categories only on custom navigation (dual navigation)

texts:
I've been working on having a two sets of layered navigation to make it easier to navigate my website. I have successfully added categories and manufacturers as a tab in the center. When I enabled price (or any other attribute) to be used in the left hand layered navigation, it became visible in the center.   (See picture bellow)

The code for the center navigation:

<?php if($this->canShowBlock()): ?>

    <?php if($this->canShowOptions()): ?>
            <?php $_filters = $this->getFilters() ?>

            <?php $counterOne =0; ?>
            <?php $counterTwo =0; ?>
            <?php foreach ($_filters as $_filter): ?>
            <?php $counterOne++; ?>
            <?php if($_filter->getItemsCount()): ?>

<a href="#" title="tab<?php echo $counterOne; ?>"><?php echo $this->__($_filter->getName()) ?>

            <?php endif; ?>
            <?php endforeach; ?>

             <?php foreach ($_filters as $_filter): ?>
             <?php $counterTwo++; ?>
            <?php if($_filter->getItemsCount()): ?>
                <div id="tab<?php echo $counterTwo; ?>"><?php echo $_filter->getHtml() ?>

            <?php endif; ?>
            <?php endforeach; ?>

    <?php endif; ?>

How can I implement a filter in the above so that only the Category and Manufacturer will appear in the center layered navigation?

EDIT:

When I add:

<?php if($_filter->getName() == 'Category' || $_filter->getName() == 'Manufacturer' ): ?>

Directly bellow the first

<?php foreach ($_filters as $_filter): ?>

It works, however when I click on the Manufacturer under the manufacturer tab I receive a
You cannot define a correlation name 'manufacturer_idx' more than once

Any thoughts?

EDIT
What I am looking to achieve is to have Category and Manufacturer in the center while all other filterable attributes appear on the left.  Is this possible?


texts: How to overwrite module-ui/Component/Form/Element/DataType/Date.php::public?

texts:
I changed the prepare function in vendor/module-ui/Component/Form/Element/DataType/Date.php. Now I want to override it in a way that is update safe. How would I do that? Using my own module?

Magento 2.1.12

Thanks


texts: Magento 2.1.6 - Extending the dropdownDialog (lib/web/mage/dropdown.js) not working

texts:
I am trying to extend the default dropdown.js of Magento

1) Created a new JS file at app/design/frontend/<vendor>/<theme-name>/web/js/mage/dropdown.js

define([
    "jquery",
    "jquery/ui",
    "mage/dropdown"
], function($){
    'use strict';

    $.widget('mage.customdropdownDialog', $.mage.dropdownDialog, {
        _create: function() {
            this._super();
            console.log("Testing...");
        },
    });

    return $.mage.customdropdownDialog;
});

2) Added reference in the requirejs-config.js at app/design/frontend/<vendor>/<theme-name>/requirejs-config.js

var config = {
    map: {
        "*": {
            "dropdownDialog": "js/mage/dropdown"
        }
    }
};

3) Ran php bin/magento setup:upgrade and php bin/magento setup:static-content:deploy

I keep getting the following error whenever I try to click on any dropdown created using the dropdown.js libary.

Uncaught Error: cannot call methods on dropdownDialog prior to initialization; attempted to call method 'close'

I am not sure what I am doing wrong, can anyone please help me with this ?


texts: Magento 2 Set "Billing Same as Shipping" default to unchecked

texts:
In the Magento 2 checkout process, the second screen displays your shipping address again with a checkbox that is checked by default.

How do I make that unchecked by default, so the user can enter their billing info?


texts: Show category description in top menu Magento 2.1

texts:
i'm trying to show the categories in the top menu with the corresponding category description but can't find any function for that.

With the object manager i can get the id, name etc. but not the description.

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();

// get current store’s categories
$categoryHelper = $objectManager->get('\Magento\Catalog\Helper\Category');
$categories = $categoryHelper->getStoreCategories();

foreach ($categories as $category) {
echo $category->getId() . '
';
echo $category->getName() . '
';
print_r($category->getData());. '
';

}

Any idea how i can get each category description?


texts: How to ship Out of Stock products (backorders)?

texts:
How could I ship out of stock products (backorders)?

I see the error: Not all of your products are available in the requested quantity.

Thanks


texts: Why does Magento POST to its own /app/etc/local.xml?

texts:
It seems to be initiated at admin operations, such as catalog save/edit. As seen in the logs. The client IP for the POST is the server's internal IP.

302 2014-08-30T06:43:40+00:00 POST /index.php/admin/catalog_product/save/id/8830/key/ee3cb37b55e431ada508af992e88abbb/ HTTP/1.1
403 2014-08-30T06:43:40+00:00 POST /app/etc/local.xml HTTP/1.1
200 2014-08-30T06:48:39+00:00 GET /index.php/admin/catalog_product/edit/id/8830/key/e5c6b7e5d662d8b4c39be5b31b761f28/ HTTP/1.1
403 2014-08-30T06:48:39+00:00 POST /app/etc/local.xml HTTP/1.1


texts:
When I write a module and refresh Magento it begins to install it. What happens if I refresh Magento before installation is over? Does it start the installation process again while the other one continues?

I'm asking because when adding a large data set of attributes after refreshing the Magento page I realised that the values are duplicated in the table. Like if Magento ignored the install in progress and went ahead and started another one (without aborting the first one.)


texts: Add or remove product to given websites using product_action model

texts:
The following example sets price and name of product only for given store ID:

$product = Mage::getModel('catalog/product');

//Load product 100 from store 2
$product->setStoreId(2)->load(100);

//Set product price and name
$product->setName('Train ticket');
$product->setPrice(4.65);

//Remove website 6, add website 8, then save
$product->setWebsiteIds(array_diff(array_merge($product->getWebsiteIds(),[8]),[6]));
$product->save();

It works perfectly but Magento copies unchanged store-specific attribute values in database that do not differ from base values (they are the same as in default store 0). To avoid redundant data, you can use:

Mage::getSingleton('catalog/product_action')->updateAttributes([100], [
    'price' => 4.65,
    'name' => 'Train ticket',
], 2);

But how to add or remove website IDs this way?


texts: Does Magento 1.4.1.1 require patch SUPEE-6788?

texts:
I am using Magento 1.4.1.1 and I received a message:

  "New Magento Security Patch (SUPEE-6788) – Install Immediately"

but I could not find patch SUPEE-6788 for Magento 1.4.1.1.

Is it required to install patch SUPEE-6788 on Magento 1.4.1.1?


texts: Magento2: How to create custom model collection?

texts:
I want to create a custom cart item collection model.

I want to get already added cart items collection from the database.


texts:
I just installed a magento enterprise vs: 1.14.3.0. When I want to create a simple product, I'm getting this error:

SQLSTATE[42000]: Syntax error or access violation: 1139 Got error 'this version of PCRE is compiled without UTF support at offset 0' from regexp,

query was:

SELECT MAX(ABS(CAST(SUBSTRING(`value`, 5, LENGTH(`value`) - 4) AS SIGNED)))
FROM `catalog_product_entity_url_key`
WHERE (value LIKE :url_key)
AND (entity_id <> :entity_id)
AND ((value REGEXP '^test$') OR (value REGEXP '^test-[0-9]*$'))

I'm using lampp as local server. After I installed this package:
sudo apt-get install libpcre3 libpcre3-dev I'm still getting the error. Did someone get that error message ?  Can you help me fixing it ?

Thx

[UPDATE]

I run the following:

download latest version
enter the folder with extracted PCRE and run the following commands
sudo ./configure --prefix=/opt/lampp --enable-utf8 --enable-unicode-properties
sudo make
sudo make install
reboot your pc

But I still get the error . This is the result of the pcretest -C command:

➜  bin pcretest -C
PCRE version 8.38 2015-11-23
Compiled with
  8-bit support
  UTF-8 support
  Unicode properties support
  No just-in-time compiler support
  Newline sequence is LF
  \R matches all Unicode newlines
  Internal link size = 2
  POSIX malloc threshold = 10
  Parentheses nest limit = 250
  Default match limit = 10000000
  Default recursion depth limit = 10000000
  Match recursion uses stack


texts: Add products to sales quote in magento admin programmatically

texts:
I have customized search product grid as per client need (created new grid and disabled search grid) under sales order create page.

I have created new grid successfully after "Items Ordered" block.

When i click "Add product(s) To Item" button of my custom grid, I got product id and quantity of that selected product in my custom controller file.

I have tried to add those products to quote, Nothing has been changed. I dunno, how to add these selected products from my custom grid under "Items Ordered" block.

I have tried following code to add products to quote.

 $customer_id = 26; // set this to the ID of the customer.
 $customerObj = Mage::getModel('customer/customer')->load($customer_id);
 $quoteObj=Mage::getModel('sales/quote')->assignCustomer($customerObj);
 $quoteObj = $quoteObj->setStoreId(Mage::app()->getStore()->getId());
 $productModel=Mage::getModel('catalog/product');
 $productObj = $productModel->load($_id);
 $quoteItem = Mage::getModel('sales/quote_item')->setProduct($productObj);
 $quoteItem->setQty($qty);
 $quoteObj->addItem($quoteItem);
 $quoteObj->collectTotals();
 $quoteObj->save();

I'm not sure, That block containing quote products or else

Have any idea, How to add selected products to "Items Ordered" block in sales order create page.

Eagerly awaiting for your response!


texts: 3 Shipping options in shipping method magento

texts: I am working on site .where now i want to show 3 options for the shipping method like 1) UK base (2) Europ Base (3) Rest world.I try to add direct code to collectRates function of Carrier model but didn't succeded.Can anyone guide me how can i do it ? Thanks


texts: how to prevent customer from using multiple discounts with coupons code

texts: I want to create a discount code that will allow x% discount on the customer's cart but I want to exclude items that already have a discount applied (Special Price) but also want to exclude items that have a discount applied. finally, I want the customer to get a discount or a coupon.


texts:
I have an error in product page:

  "You cannot define a correlation name 'links' more than once"

Does anyone know what can it be? I tried to find answer for a long time.

This is a very basic site, no special modules or themes.

Thank you,
Eran


texts: Redirect Customers to Forgot Password page after number of unsuccessful login attempts exceeded

texts: I want to know how can i redirect a user to the Forgot Password page after exceeding the number of unsuccessful login attempts in Magento 2. Thanks.


texts: Social media login fb login and other need tutorial for magento 1.9.2

texts:
I have used an extension and integrated fb login with the Facebook App ID & Facebook App Secret key but in the end getting some error as "Can't load URL: The domain of this URL isn't included in the app's domains. To be able to load this URL, add all domains and sub-domains of your app to the App Domains field in your app settings."
Could anyone please suggest a better tutorial and any free extension for magento 1.9.


texts: Configurable product swatch option for size not shown

texts: When the variation product(Simple Product) is having a QTY 2 or 3 then that variation size is hidden  means we can't buy why is it so


texts: how to update cart subtotal after change item price with observer magento 1.8

texts:
$aPost  = Mage::app()->getFrontController()->getRequest()->getPost();
         $id = $aPost['product'];

         $qty = $aPost['qty'];
         $product = Mage::getModel('catalog/product')->setStoreId(Mage::app()->getStore()->getId())->load($id);
         $bundleType = $product->getTypeId();
         if ($bundleType == 'bundle') {
         $collection = $product->getTypeInstance(true)->getSelectionsCollection($product->getTypeInstance(true)->getOptionsIds($product), $product);
         $itemIds = array();
         $b=0;
         $n=1;

         foreach ($collection as $item) {

             if($n == 1) {$price = $item->getPrice();}
             $sku = $item->getSku();
             if($sku = 'shoose01') {
                 $b=20;
             } elseif ($sku = 'shoose01') {
                 $b=30;
             } elseif ($sku = 'simple2122'){
                 $b=40;
             } elseif ($sku = 'moniteur24'){
               $b=60;
             } else {
                $b=0;
             }
             $n++;
         }
         }
            $single_price = $price+$b;

$single_price=50;
if($bundleType == 'bundle') {
            $item->setCustomPrice($single_price);
            $item->setOriginalCustomPrice($single_price);
             }

Use of setCustomPrice() and setOriginalCustomPrice() functions for only single product amount and grand total amount updating , but not updating sub total of single item as well sub total of all amount.

Check above Screen Shot.

if you have any solution. Then let me know.


texts: Magento 2.2: How to show a cutomer custom attribute on frontend?

texts:
I need to show my custom attribute in the next windows:

On the address book:

On the checkout page:

And in the backend customer edit:

  It is possible assign the attribute with XML file without edit all the
  phtml files?


texts: State of the Art in Magento 2 Product Imports

texts: Now that Magento 2's been out for a year plus -- what's "state of the art" in getting product information into the system?  i.e. Are people still writing one-off import scripts?  Is the native import/export sufficient?  Is there a third party module that's great for this?  Third party services? etc.


texts: Programmatically reorder multiple orders

texts:
In my Magento custom module I'm trying to go through array of some orders and re-order each. However, I'm facing strange issue.

The first order from that array is well reordered, but all other orders are not reordered correctly. Precisely, items from my first order are also copied to second order, then items from first and second orders are copied to third order, and so on. Moreover, all Order Total prices (Subtotal, Shipping & Handling, Tax, Grand Total, ...) are zero (for all orders except for the first one which are correct).

This is the code i have so far:

$orderIds = /* ARRAY OF ORDER ID's */
foreach($orderIds as $orderId) {

        $origOrder = Mage::getModel('sales/order')->load($orderId);

        // clear the session data
        Mage::getSingleton('adminhtml/session_quote')->clear();
        Mage::unregister('rule_data');

        $orderModel = Mage::getSingleton('adminhtml/sales_order_create');
        //I also tried $orderModel = Mage::getModel('adminhtml/sales_order_create'); but without success

        $orderModel->getSession()->clear();
        $origOrder->setReordered(true);
        $orderModel->setRecollect(true)->saveQuote();
        Mage::getSingleton('adminhtml/session_quote')->setUseOldShippingMethod(true);

        $reorder = $orderModel->initFromOrder($origOrder);

        try {
            $reorder->createOrder();
            $orderModel->getSession()->clear();
        } catch (Exception $e) {
            Mage::log("Not Reordered! Error: ".$e->getMessage());
        }
}

Similar question has been raised here, but without answer: Auto reorder loop - Second order errors out

I'm using Magento versions 1.6 and 1.7. I would greatly appreciate any help!


texts: configuring cron jobs for Magento on Centos Magento 1.7

texts:
Thanks in advance for any assistance.

I am trying to set up cron jobs for magento.

Crontab -e was empty so I pasted the following.

# All the comment lines will start with '#' character.

# in the beginning of the file set environment variables to be used in executed tasks:
# ENV_VAR="value"

# the following line will send output for executed tasks to specified email:
MAILTO=me@domain.com

# declare running tasks in the following pattern:
# <minute> <hour> <day-of-month> <month> <day-of-week> <command>

# this example will run /var/www/public_html/cron.php every 15 minutes:
15 * * * * /var/www/public_html/cron.php

I then changed cron.php to 775 and get emailed the following;

/var/www/public_html/: line 1: ?php: No such file or directory
/var/www/public_html/: line 2: /backup: is a directory
/var/www/public_html/: line 3: 091214db.sql: command not found
/var/www/public_html/: line 4: 091214db.sql: command not found
/var/www/public_html/: line 5: 091214db.sql: command not found
/var/www/public_html/: line 6: 091214db.sql: command not found
/var/www/public_html/: line 7: syntax error near unexpected token `('
/var/www/public_html/: line 7: ` * This source file is subject to the Open Software License (OSL 3.0)'

After making the changes suggested

  15 * * * * /usr/bin/php /var/www/public_html/cron.php

I now get the following email report

# location of the php binary
if [ ! "$1" = "" ] ; then
CRONSCRIPT=$1
else
CRONSCRIPT=cron.php
fi

PHP_BIN=`which php`

# absolute path to magento installation
INSTALLDIR=`echo $0 | sed 's/cron\.sh//g'`

#       prepend the intallation path if not given an absolute path
if [ "$INSTALLDIR" != "" -a "`expr index $CRONSCRIPT /`" != "1" ];then
if ! ps auxwww | grep "$INSTALLDIR""$CRONSCRIPT" | grep -v grep 1>/dev/null      2>/dev/null ; then
    $PHP_BIN "$INSTALLDIR""$CRONSCRIPT" &
fi
else
if  ! ps auxwww | grep " $CRONSCRIPT" | grep -v grep | grep -v cron.sh       1>/dev/null 2>/dev/null ; then
    $PHP_BIN $CRONSCRIPT &
fi
fi


texts: changing the database shows error report

texts:
We have developed  devlopment site in magento 1.8 for our live site. We have added the required plugins and designed the home page in dev site.  Then we have updated the database from live to development server. (which is 1.7)
While clear the cache, shows the error.
The error is:

a:5:{i:0;s:226:
"Error in file: "/home/cardsd/public_html/app/code/core/Mage/Paypal/data/paypal_setup/data-upgrade-1.6.0.2-1.6.0.3.php" - SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'paypal_reversed' for key 'PRIMARY'"
;i:1;s:869:"
#0 /home/cardsd/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(645): Mage::exception('Mage_Core', 'Error in file: ...')
#1 /home/cardsd/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(407): Mage_Core_Model_Resource_Setup->_modifyResourceDb('data-upgrade', '1.6.0.2', '1.6.0.4')
#2 /home/cardsd/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(286): Mage_Core_Model_Resource_Setup->_upgradeData('1.6.0.2', '1.6.0.4')
#3 /home/cardsd/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(269): Mage_Core_Model_Resource_Setup->applyDataUpdates()
#4 /home/cardsd/public_html/app/code/core/Mage/Core/Model/App.php(351): Mage_Core_Model_Resource_Setup::applyAllDataUpdates()
#5 /home/cardsd/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#6 /home/cardsd/public_html/index.php(87): Mage::run('', 'store')
#7 {main}";s:3:"url";s:66:"/index.php/admin/cache/index/key/ddb59108c0b38a2c9c5972afb1c2a499/"
;s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"default";}

Also, my home page sale.phtml and new.phtml files are displayed without products.

Any help is appreciated.


texts:
I've been following a few guides online about adding a JS file to a module but it seems to be going awry for a reason I can't figure out.

My JS is a simple file:

define([
    'jquery',
    'underscore',
    'mage/template',
],
function($, _, template)
{
    'use strict';
    console.log('hello world');
})

I've been trying to add via my requirejs-config.js file:

var config = {
    deps: [
        'js/main'
    ]
};

Path to my main.js file is web/js, I then run the usual compile, upgrade, deploy, cache:flush functions in CLI afterwards but when I go to my frontend page - nothing in console and my main.js file isn't in the <head> element.

What am I doing wrong?

Edit: full file structure for clarity

|-Vendor
|-----Module
|---------Block
|-------------Garage.php
|---------Controller
|-------------Customer
|-----------------Index.php
|---------etc
|-------------frontend
|-----------------routes.xml
|-------------module.xml
|---------registration.php
|---------requirejs-config.js
|---------view
|-------------frontend
|-----------------layout
|---------------------customer_account.xml
|---------------------default_head_blocks.xml
|---------------------garage_customer_index.xml
|-----------------templates
|---------------------garage.phtml
|---------web
|-------------js
|-----------------main.js

Edit: my default_head_blocks.xml file

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <script src="Vendor_Module::js/main.js" />
    </head>
</page>

Edit: I've run the above commands (post-updates):

$ php bin/magento setup:upgrade
$ php bin/magento setup:di:compile
$ php bin/magento setup:static-content:deploy -f
$ php bin/magento cache:flush
$ chown -R www-data:www-data var/ && chmod -R 777 var/
$ chown -R www-data:www-data pub/ && chmod -R 777 pub/
$ chown -R www-data:www-data generated/ && chmod -R 777 generated/

This renders the JS path as http://site.local/static/version1544529237/frontend/Theme/default/en_US/Vendor_Module/js/main.js - which 404s.


texts: admin panel: system->configuration page not working

texts:
I am facing one problem with Magento 1.9. When I click on Configuration then it shows 505 internal page isn't working error. I don't know how to fix. Attached is the screenshot. If any file needed from my side please request in comment box.
Error log:
[18-Oct-2020 14:57:53 UTC] PHP Fatal error:  Uncaught TypeError: Argument 1 passed to Varien_Data_Form_Element_Abstract::setRenderer() must implement interface Varien_Data_Form_Element_Renderer_Interface, instance of Pixlogix_Shippingavailability_Block_Adminhtml_System_Configuration_Implementation given, called in /home/lxc8uxjzilec/public_html/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php on line 438 and defined in /home/lxc8uxjzilec/public_html/lib/Varien/Data/Form/Element/Abstract.php:164
Stack trace:
#0 /home/lxc8uxjzilec/public_html/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php(438): Varien_Data_Form_Element_Abstract->setRenderer(Object(Pixlogix_Shippingavailability_Block_Adminhtml_System_Configuration_Implementation))
#1 /home/lxc8uxjzilec/public_html/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php(229): Mage_Adminhtml_Block_System_Config_Form->initFields(Object(Varien_Data_Form_Element_Fieldset), Object(Mage_Core_Model_Config_Element), Object(Mage_Core_Model_Config_Element))
#2 /home/lxc8uxjzilec/public_html/app/ in /home/lxc8uxjzilec/public_html/lib/Varien/Data/Form/Element/Abstract.php on line 164

.


texts: Filtering Magento product collection by multiple categories using AND condition

texts:
I trying to display a list of products in Magento based on multiple categories. I'm using the following code which works well:

$collection = Mage::getModel('catalog/product')->getCollection()
->addAttributeToSelect('id')
->addAttributeToSelect('sku')
->addAttributeToSelect('name')
->addAttributeToFilter('status', 1)
->addAttributeToFilter('visibility', 4)
->addStoreFilter();

$catfilters = "1981,1982,1983";
$conditions = array();
foreach ($catfilters as $categoryId) {
     if (is_numeric($categoryId)) {
          $conditions[] = "{{table}}.category_id = $categoryId";
     }
}

$collection->distinct(true)
->joinField('category_id', 'catalog/category_product', null, 'product_id = entity_id', implode(" OR ", $conditions), 'inner');

This works well and lists all products with category 1981, 1982 and 1983. So far so good but I also would like to filter on a fourth category "1984" but this should be using an "AND" condition. In order words: (1981 OR 1982 OR 1983) AND (1984).

After having read up on it I believe I need to add another joinField but I'm not sure how it would be done. Any help would be really appreciated.


texts: How to remove decimals from Price in magento 2.3.0?

texts: i want to remove decimals from Price in magento 2.3.0


texts: What is the purpose of signifyd.fingerprint block in checkout page in magento2?

texts:
what is the purpose of "signifyd.fingerprint" block on checkout page in magento2

I have checked in

  /var/www/html/name/vendor/magento/module-signifyd/view/frontend/layout/checkout_index_index.xml


texts:
I trying make event observer with save_after.
This is an attempt to set Meta Title automatically when saving my products.
Creating a module:
So looks like the folder structure:

Observer.php code:

<?php
class Unnamed_MyModule_Model_Observer
    {
        public function catalog_product_save_after($observer)
        {
            $product = $observer->getProduct();
            if(!$product->getMetaTitle()){
                $name = $product->getName();
                $metaTitle = str_replace(' - ', ' ', $name);
                $product->setMetaTitle($metaTitle);
                $product->getResource()->saveAttribute($product, 'meta_title');
            }
        }
    }

config.xml code:

<?xml version="1.0"?>
<global>
    <events>
        <catalog_product_save_after>
            <observers>
                <unnamed_mymodule>
                    <type>singleton</type>
                    <class>Unnamed/MyModule</class>
                    <method>catalog_product_save_after</method>
                </unnamed_mymodule>
            </observers>
        </catalog_product_save_after>
    </events>
</global>
</code>

magento/app/etc/modules Unnamed_MyModule.xml code:

<config>
    <modules>
        <Unnamed_MyModule>
            <active>true</active>
            <codePool>local</codePool>
        </Unnamed_MyModule>
    </modules>
</config>

It seems to me that there are no errors. But It is not work.
optional: magento 1.9, CE, I'm a beginner.
Tell me what is wrong?
Thanks!


texts:
I am trying to upload product price with just two column "sku" and "price".
when i am checking data , its successful but when i am trying to import i am getting this following issue
SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`zest`.`catalog_category_product`, CONSTRAINT
`CAT_CTGR_PRD_CTGR_ID_SEQUENCE_CAT_CTGR_SEQUENCE_VAL` FOREIGN KEY (`category_id`) REFERENCES `sequence_catalog_category` (`sequence_value`) ON DEL), query was: INSERT INTO `catalog_category_product`
(`product_id`,`category_id`,`position`) VALUES (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?)
ON DUPLICATE KEY UPDATE `product_id` = VALUES(`product_id`),
`category_id` = VALUES(`category_id`)

Please help me to fix this. Thanks in advance.


texts: How to get attribute_id from “eav_attribute” table in Magento

texts:
I need to get attribute_id from eav_attribute table, I have attribute_code and frontend_label, my sql query will be some thing like this.

select attribute_id from eav_attribute where attribute_code = 'sb_store_id'

What will be its equivalent magento statement.


texts: Magento 2.2.3 - Add custom required validation for company

texts:
I want to add validation only for billing address on the checkout page.

By default in the backend, the company name is optional.

But if when I go to the checkout page and click on the Place Order button then I want to add require field validation for company field.

In which company name is not available so I just want to trigger that required.

Does have any idea about this?


texts: Magento 2 cdn issue for modal popup - KeyCdn

texts:
We uses KeyCdn to use cdn feature for magento 2.
We use push zone for one of our website for testing.
KeyCdn working fine except modal popup CORS issue.

We are facing below error.

Access to XMLHttpRequest at 'cdn.xxx.keycdn.net/pub/static/frontend/Abc/xyz/en_US/Magento_Ui/templates/modal/modal-popup.html' from origin 'www.xyz.org' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

I enabled CORS from KeyCdn panel but it was not resolved our issue.
We read some blogs to allow CORS in magento 2 and put below code in .htaccess files but it was also not working.

MAGNETO_ROOT/pub/.htaccess

<IfModule mod_headers.c>
    ############################################
    ## Prevent clickjacking
    #Header set X-Frame-Options SAMEORIGIN

    ## Put by developer
    <FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2|font.css|css|js|html|json)">
        Header set Access-Control-Allow-Origin "*"
        Header set Access-Control-Allow-Headers "Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With"
        Header set Access-Control-Allow-Methods "POST, GET, OPTIONS"
    </FilesMatch>
    ## End
</IfModule>

Please help me, how to resolve CORS issue.


texts:
So i placed this block of code in the Hompage CMS.

{{block type="catalog/product_list" category_id="21" template="catalog/product/list.phtml"}}

It works, but the product layout on the front page, makes some holes in the layout.
Can i change it? and maybe add a third column?

More zommed out


texts:
I am using Magento 2.1.7 version.
The customer is able to write a review from product detail page, and review is approved by admin.
But Customer reviews is not showing in product detail page.
This block is showing empty

and getting this error in console

  http://xxx/review/product/listAjax/id/200/ 500 (Internal Server Error)

When I hit this Link in the browser then getting this error -
Item (Magento\Review\Model\Review\Interceptor) with the same ID "4" already exists.


texts: I want to understand the Enterprise Edition catalog target rules and What are additional features of target rule module over the CE Catalog?


texts: Normal and Editing views/template for block

texts:
I'm redesigning a small part of a website which previously had a set of customer account items which were directly editable simply by showing the textboxes/inputs, radio buttons, checkboxes, etc, directly.

Now I need to have two different views of the same block: one for normal viewing and one for editing said information.

This is to occur on the frontend.

So, this is what I have now:

And this is what I intend to achieve when clicking in Endre (means Edit):

I don't know how I'll implement the behaviour shown in the second image, but since I need to "fade" the background view (the darker part) I'm guessing I should be doing it via a Modal Box and an AJAX request to this view/template.

Am I correct to assume this? And how should I go about creating this edit view? What do I need to insert into my local.xml and what's the best way of doing this? Having a different template (.phtml file) for this view?


texts: I'm brand new to Magento, so bear with me. Let's say I built a module in Magento that houses an image and some text, and I wanted to include that module 3 times on a specific page. How would I add authoring capabilities to allow an author to put a different image and text inside each module?


texts:
When I try to edit an order in the Magento backend. After order edited the username setted Guest, but in parent order usernames set John.

I have order s1.micp.ru/UQcmB.png In order user name is TEST after I edited order the user name setted Guest s3.micp.ru/Acx6y.png but i didn't change username

How can i fix it?


texts: How to skip some products to addtocart when reorder in magento 2?

texts:
I want to skip some products whenever reorder. file path in vendor folder (vendor/magento/module-sales/Controller/AbstractController/Reorder.php:57) and it is an abstract Class.

I want simply add this code condition.
 if($item->getSku() != 'offer123')
Is it possible by plugin ?

foreach ($items as $item) {
   if($item->getSku() != 'offer123'){ // i want to apply this condition
            try {
                $cart->addOrderItem($item);
            } catch (\Magento\Framework\Exception\LocalizedException $e) {
                if ($this->_objectManager->get(\Magento\Checkout\Model\Session::class)->getUseNotice(true)) {
                    $this->messageManager->addNotice($e->getMessage());
                } else {
                    $this->messageManager->addError($e->getMessage());
                }
                return $resultRedirect->setPath('*/*/history');
            } catch (\Exception $e) {
                $this->messageManager->addException($e, __('We can\'t add this item to your shopping cart right now.'));
                return $resultRedirect->setPath('checkout/cart');
            }
}
        }

Thanks in advance.


texts: Can't upload and save table rates in magento 2

texts:
this my csv sample file. I upload csv file and press save config  then show

this is my setting.How can i fix this.


texts: Magento 1 - Custom required formfield on checkout

texts:
I have added a custom textarea field on the shippingmethode section.
That field needs to be required. Is there any way to do this?

Basicly it has this content;
https://jsfiddle.net/bbsrsbbd/1/

<form id="co-shipping-method-form" action="">

  <textarea rows="6" name="shipping_arrival_comments" id="shipping_arrival_comments" placeholder="Comments here"></textarea>

  <button type="button" class="button" onclick="shippingMethod.save()"><?php echo $this->__('Continue') ?></button>

</form>

When clicking on the button it has to validate/check if the textarea is empty or not.

Is there someone who can point me to the right direction?
Rather don't have it too advanced.
Adding just required="required" doesn't work unfortinately.

This works when I add this script but it goes to the next order section when I click on the button.

<button type="button" class="button" onclick="shippingMethod.save(); val();">


texts: I want to disable (complecty remove everything that comes with this module, I mean options in My account, checkout, cart etc) but disabling it by command seems problematic beacuse of modules that depends on it, do you have any idea how can I remove this feature from magento?


texts:
Magento ver. 2.0.7

Hello, I'm trying to reindex my store so that products I added from the backend will show up on the frontend.

As shown below, after running bin/magento indexer:reindex, every index has been rebuilt successfully but bin/magento indexer:status shows some of the indices still processing as confirmed in the Admin Panel > System > Index Management

What can I do to resolve this? My website no longer shows any products.

[user@server root]$ bin/magento indexer:reindex
Customer Grid index has been rebuilt successfully in 00:00:00
Category Products index has been rebuilt successfully in 00:00:00
Product Categories index has been rebuilt successfully in 00:00:00
Product Price index has been rebuilt successfully in 00:00:04
Product EAV index has been rebuilt successfully in 00:00:06
Stock index has been rebuilt successfully in 00:00:00
Catalog Rule Product index has been rebuilt successfully in 00:00:00
Catalog Product Rule index has been rebuilt successfully in 00:00:00
Catalog Search index has been rebuilt successfully in 00:00:00

[user@server root]$ bin/magento indexer:status
Customer Grid:                                     Processing
Category Products:                                 Processing
Product Categories:                                Processing
Product Price:                                     Ready
Product EAV:                                       Ready
Stock:                                             Ready
Catalog Rule Product:                              Ready
Catalog Product Rule:                              Ready
Catalog Search:                                    Processing


texts: "Cannot add the item to shopping cart." For no apparent reason

texts:
I have a slightly strange problem that I need your help with.

I have three independent Magento installations on my server. Two of which under an SSL certificate as such: https ://apps.domain.com/store1 & https ://apps.domain.com/store2. Both of these stores how custom themes. The third installation is a fresh install on the root of the domain without an SSL certificate as such: http:// www.domain.com/store3

What happens is that, all of a sudden, all three stores stop being able to add items to cart and give me this error "Cannot add the item to shopping cart.". And then an hour or a couple of hours later or so, the add to cart buttons start working again. The weird thing is that I don't change anything to make it work or stop working, and they all work or stop working simultaneously.

I'm using magento 1.8.

Please advise!

Update:

Actually I found this in my exception log:

2014-07-27T21:09:35+00:00 DEBUG (7): Exception message: Notice: Undefined offset: 2  in /home/---/store2/lib/Zend/Locale/Format.php on line 577
Trace: #0 /home/---/store2/lib/Zend/Locale/Format.php(577): mageCoreErrorHandler(8, 'Undefined offse...', '/home/vmegypt/p...', 577, Array)
1 /home/---/store2/lib/Zend/Locale/Format.php(513): Zend_Locale_Format::_getRegexForType('decimalnumber', Array)
2 /home/---/store2/lib/Zend/Filter/LocalizedToNormalized.php(100): Zend_Locale_Format::isNumber('3', Array)
3 /home/---/store2/app/code/core/Mage/Checkout/controllers/CartController.php(187): Zend_Filter_LocalizedToNormalized->filter('3')
4 /home/---/store2/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Checkout_CartController->addAction()
5 /home/---/store2/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('add')
6 /home/---/store2/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
7 /home/---/store2/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
8 /home/---/store2/app/Mage.php(683): Mage_Core_Model_App->run(Array)
9 /home/---/store2/index.php(117): Mage::run('', 'store')
10 {main}
2014-07-27T21:09:35+00:00 ERR (3):
exception 'Exception' with message 'Notice: Undefined offset: 2  in /home/---/store2/lib/Zend/Locale/Format.php on line 577' in /home/---/store2/app/code/core/Mage/Core/functions.php:245
Stack trace:
0 /home/---/store2/lib/Zend/Locale/Format.php(577): mageCoreErrorHandler(8, 'Undefined offse...', '/home/vmegypt/p...', 577, Array)
1 /home/---/store2/lib/Zend/Locale/Format.php(513): Zend_Locale_Format::_getRegexForType('decimalnumber', Array)
2 /home/---/store2/lib/Zend/Filter/LocalizedToNormalized.php(100): Zend_Locale_Format::isNumber('3', Array)
3 /home/---/store2/app/code/core/Mage/Checkout/controllers/CartController.php(187): Zend_Filter_LocalizedToNormalized->filter('3')
4 /home/---/store2/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Checkout_CartController->addAction()
5 /home/---/store2/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('add')
6 /home/---/store2/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
7 /home/---/store2/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
8 /home/---/store2/app/Mage.php(683): Mage_Core_Model_App->run(Array)
9 /home/---/store2/index.php(117): Mage::run('', 'store')
10 {main}


texts: Magento programatically can't able to add multiple product

texts:
In Multiple product i can't able to add in cart

controller.php

public function addtocartAction(){
      /* Get Product id From Form Post */
        $product_id = $this->getRequest()->getPost('productids');
      /* Get Product id From Form Post */

      /* Add Product in to Cart */
        $product=new Mage_Catalog_Model_Product();
        $product->load($product_id); // Product Id
        $quote = Mage::getSingleton('checkout/session')->getQuote();
        $quote->addProduct($product); // quantity is 1
        $cart = Mage::getSingleton('checkout/cart');
        $cart->init(); // tried commenting this too!
        $cart->save();
        Mage::getSingleton('checkout/session')->setCartWasUpdated(true);
        $quote->collectTotals()->save();
        $this->_redirectReferer();
        Mage::getSingleton('core/session')->addSuccess('Your product has been Added successfully...');
      /* Add Product in to Cart */
    }

productids contain 1,2,3 but i can add only one product what is the problem here?


texts: Equivalent class for Mage_Widget_Block_Interface in magento2

texts:
What is the equivalent class for Mage_Widget_Block_Interface in Magento2

I need to

class Vendor_Module_Block_Related_Search extends Mage_Core_Block_Template implements Mage_Widget_Block_Interface
{
   ...
}

in Magento2


texts:
I am trying to convert a \Magento\Sales\Api\Data\OrderInterface object to an array using \Magento\Framework\Api\ExtensibleDataObjectConverter.
I think it is not relevant here but I am using Magento CE 2.1.4

Here is the code I use :

<?php

use Magento\Framework\Api\ExtensibleDataObjectConverter;

public function __construct(
    [...]
    ExtensibleDataObjectConverter $dataObjectConverter
) {
    [...]
    $this->dataObjectConverter = $dataObjectConverter;
}

public function get()
{
    /** @var \Magento\Sales\Api\Data\OrderInterface $order */
    $order = $this->orderRepository->get($orderId);

    /** @var array $data */
    $data = $this->dataObjectConverter->toFlatArray($order);
}

But here is the error I got :

  Getter return type must be specified using @return annotation. See Magento\Sales\Model\Order::getPayment()

If we take a look at \Magento\Framework\Reflection\TypeProcessor::getGetterReturnType() there is this line :

$returnAnnotations = $methodDocBlock->getTags('return');

Which is using \Zend\Code\Reflection\DocBlockReflection::getTags() to list all DockBlock tags and check if there is a return

Now if we take a look at \Magento\Sales\Model\Order::getPayment() here is the actual function declaration :

/**
 * {@inheritdoc}
 */
public function getPayment()
{
    [...]
}

To fix this issue I have to manually add the @return tag to \Magento\Sales\Model\Order::getPayment()

According to https://www.phpdoc.org/docs/latest/guides/inheritance.html#methods the @return tag is subject to the inheritance so I should not have to put the @return tag in addition to the @inheritdoc one.

My questions are simple :

Is that a bug?
Am I using the wrong method to convert object to
array in Magento 2?


texts: How to remove breadcrumbs from category page in Magento 2

texts: I am messing with an issue in Magento 2 site. I have to remove breadcrumbs from the category page. I have also to remove the toolbar from the same page.


texts: Call Custom function after binding customer name in magento2?

texts:
I have updated the customer name using ko.

After binding customer name, I want to add one custom class.

            <button type="button"
                    class="action switch"
                    tabindex="-1"
                    data-action="customer-menu-toggle">
                <?php echo $block->escapeHtml(__('Change')) ?>
            </button>

How to call the custom function after binding customer name.

Thanks.


texts: M2.3.1 - Remove currency symbol from price

texts:
Is it possible to get the price without currency symbol, or a way to put a div around the currency symbol to hide it with css?

$block->formatCurrency($block->getDisplayValue(), (bool)$block->getIncludeContainer())

If I remove the $block->formatCurrency I get the price without currency symbol, but a 1 will be added at the end of the price.

So I would like to put a div around the currency symbol and hide it with CSS.

Someone who can help me with that?

EDIT: I also want to add ,- behind the price.


texts: product added to wishlist from compare window added twice

texts:
I added a product to compare and from the compare window I added the product to wishlist, then same product got added twice.

I had this issue in the magento installation for my client. Then I tried it on the default installation and had the same issue. Is this magento bug or am I doing something wrong?


texts: Manufacturer attribute is not working on advanced search page

texts:
I have added manufacturer attribute in advanced search page. when i am searching product by manufacturer its showing error You have to specify at least one search term. but when i am searching with category then its working fine.

If i am going to search only by Manufacturer then i am facing an error message like “You have to specify at least one search term”.


texts: Multi Conditionals (OR and AND inside AND) in addAttributeToFilter

texts:
How to create a multi-condition in addAttributeToFilter?

I want result in a SQL query like this (image attached) :

WHERE ((`e`.`news_from_date` > '2013-09-12') OR (`e`.`news_to_date` < '2013-09-12'))
AND ((((`e`.`special_price` IS NULL))) OR (((`e`.`special_price` IS NOT NULL)) AND ((`e`.`special_from_date` < '2013-09-12') OR (`e`.`special_to_date` > '2013-09-12'))))

$collection->addAttributeToFilter('special_price', array('null'=>'special_price'), 'left');

Thank you


texts: Importing custom options for products - magento 1.7.0.0

texts:
I've seen a few similar threads that asked this question but they were either using an outdated version or did not exactly meet my needs. So I thought I'd ask here:

Does Magento allow importing of custom options for "simple products" ? (ver 1.7.0.0)
If it doesn't, by default, is there an easy way to allow such functionality?

Note: If neither of these are possible, I am also open to suggestions about extensions (free or not) that address this need.


texts: Remove telephone field in PDF Print-outs in Magento 1.9

texts:
Look at my screenshot. In System >> Configuration >> Customer Configuration >> Address templates >> PDF i removed the telephone lines.

But still the telephone numbers shows up in the Invoice PDF under Ship too / Bill to (client information).

How do i remove telephone lines completely from the PDF Print-outs in Magento 1.9?


texts: Add custom URL rewrites using the Rest API?

texts:
Can this be done?
Resource Access is All but I can't seem to see the endpoint in Swagger?
Magento 2.3.2
https://github.com/magento/magento2/issues/29509


texts:
An order was placed at my store with item that was having 36 Lbs weight and total 25 items were fetched in the same order. But the shipping rate charged by Fedex seems abnormal(order price was $6299 and fedex 3 day freight charges were $3075). Total $9300 were charged to the customer.
I went to Fedex ratefinder site and input the source , destination detials it gave me the following results

I also had enabled logs for fedex and Here is the response that was logged for that particular order.
Is there something wrong here in the logs? Or is there something wrong at my store end which is causing these rates that are almost 50 percent of the price of order placed?


texts:
I have prepared one module in which I have used Image upload button. And My button is working fine unless I am not entering any "Disallowed file type". When I enter any disallowed file type it gives me exception.

I have written the below function to upload file of my required file-type and to handle exception. I have also prepared required block and model file for image upload. I have followed this post

public function uploadFileAndGetName($input, $destinationFolder, $data)
{
    try {
        if (isset($data[$input]['delete'])) {
            return '';
        } else {
            $uploader = $this->uploaderFactory->create(['fileId' => $input]);
            $uploader->setAllowedExtensions(['jpg', 'jpeg', 'gif', 'png']);
            $uploader->setAllowRenameFiles(true);
            $uploader->setFilesDispersion(true);
            $uploader->setAllowCreateFolders(true);
            $result = $uploader->save($destinationFolder);
            return $result['file'];
        }
    } catch (\Exception $e) {
        if ($e->getCode() != \Magento\Framework\File\Uploader::TMP_NAME_EMPTY) {
            throw new FrameworkException($e->getMessage());
        } else {
            if (isset($data[$input]['value'])) {
                return $data[$input]['value'];
            }
        }
    }
    return '';
}

When I enter any disallowed file-type, it gives me blank page and gives error "Disallowed file type".

If anyone faced this issue, please help me.


texts: Magento 2 | Item with the same ID already exists when join tables

texts:
In my class I have filtered my collection by tier price and quantity.
If I put the display of only 3 products the code works, while if I set the display for all products I get this problem:
Item (Magento\Catalog\Model\Product\Interceptor) with the same ID "42" already exists

This is my code
namespace Vendor\Module\Block;
class ProductCollection extends \Magento\Framework\View\Element\Template
{

protected $_productCollectionFactory;

    public function __construct(
        \Magento\Backend\Block\Template\Context $context,
        \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory,
        array $data = []
    )
    {
        $this->_productCollectionFactory = $productCollectionFactory;
        parent::__construct($context, $data);
    }

public function getProductCollectionSearch() {
        $collection = $this->_productCollectionFactory->create();
        $collection->addAttributeToSelect('*');
        $collection->setPageSize(3);

        $collection->getSelect()->join('catalog_product_index_price as price_index', 'e.entity_id = price_index.entity_id');
        $collection->getSelect()->join('catalog_product_entity_tier_price as tier', 'price_index.entity_id = tier.entity_id');

        $collection->addFinalPrice()
            ->addMinimalPrice()
            ->getSelect()
            ->where('tier.all_groups = 0')
            ->where('tier.qty = 1000')
            ->where('tier.value <= 0.20');

        return $collection;
    }
}

Where is the issue?


texts:
Ubuntu
Hello
I would like to create and design an online store by using Magento 2.
I'm planning to install Magento 2.4 on a linux server.
Could you please help me with the following?

Which SQL server is more secure and faster (performance) for Magento - MariaDB or MySQL?
Which Web server is more secure and faster (performance) for Magento - Apache or Nginx?

Thanks and best regards,
Noury


texts: Adding wallet system to magento2 customers

texts: I want to create a custom wallet for the magento store customers. I am not able to get any tutorials regarding this. Can anyone pls help me in creating a wallet for my store.


texts: How can I show my Paypal Express shortcut button on a configurable product page?

texts:
My PayPal express shortcut button is showing on my simple products but for some reason will not show (on the product view page) for my configurable product.

Within the file /app/design/frontend/default/MY-TEMPLATE/template/catalog/product/view/addtocart.phtml the following line is not being pulled in.

<?php echo $this->getChildHtml('', true, true) ?>

I'm not entirely sure which file this calls directly but it does enable /app/design/frontend/default/asd/template/paypal/express/shortcut.phtml which is the one I want.

Perhaps PayPal express is not set-up to facilitate product variations that can be changed on screen but that doesn't make a huge amount of sense. If someone can please help or comment that would appreciated.


texts: Form validation div sometimes doesn't show up, even though requirements are met

texts:
I have added length validation to my address field.
Validation gets updated with a keypress:

$('street_1').on('keyup', function(e){
        Validation.validate($('street_1'))
    });

Validation has two states: validation-passed, where the error div is opacity: 0; display: none:

And validation-failed, when it displays the error:

BUT, often if I type past the limit, it will go in validation-failed, but error div will still be display: none...Why is this happening?

Perhaps is something to do with the "fading" effect?


texts:
I am trying to get the Lastly added Quote Item using "checkout/session".

By I don't know, how to get the last added Item. Hence I have product_id.

I believe instead of loading the collection and all, there would be some function.
Can anyone help me out?


texts: Magento get read or write connection for model / resource model

texts:
I have 3 databases (in addition to the magento one) connected to magento with models (non-eav) defined for the tables.

They all have their read and write connections defined in the local.xml

        <cloudvm_db>
            <connection>
                <host><![CDATA[SERVER]]></host>
                <username><![CDATA[USER]]></username>
                <password><![CDATA[PASS]]></password>
                <dbname><![CDATA[cloudvm]]></dbname>
                <model>mysql4</model>
                <type>pdo_mysql</type>
                <active>1</active>
            </connection>
        </cloudvm_db>
        <cloudvm_read>
            <connection>
                <use>cloudvm_db</use>
            </connection>
        </cloudvm_read>
        <cloudvm_write>
            <connection>
                <use>cloudvm_db</use>
            </connection>
        </cloudvm_write>

then this is defined as the connection for the model in the modules config.xml

<models>
    <cloud_workervm>
      <class>Cloud_WorkerVM_Model</class>
      <resourceModel>cloud_workervm_resource</resourceModel>
    </cloud_workervm>
    <cloud_workervm_resource>
      <class>Cloud_WorkerVM_Model_Resource</class>
      <entities>
        <virtualmachine>

virtualmachine

        </virtualmachine>
      </entities>
    </cloud_workervm_resource>
  </models>
  <resources>
    <cloud_workervm_write>
      <connection>
        <use>cloudvm_write</use>
      </connection>
    </cloud_workervm_write>
    <cloud_workervm_read>
      <connection>
        <use>cloudvm_read</use>
      </connection>
    </cloud_workervm_read>
  </resources>

what I am trying to do is write a function(s) that you can pass the name of a model e.g. "cloud_workervm/cloudvm" and return the name of (or an object of) the read connection and the write connection


texts: Magento2 Not able to get checkbox value to save in order table

texts:
Magento2 I used below code to set checkbox value in checkout page in shipping additional step

    <input type="checkbox" name="newsletter" data-bind="checked: isRegisterNewsletter, attr: {id: 'place-order-newsletter'}"/>

How can I pass the value to order table to save it in database using observer

sales_model_service_quote_submit_before


texts: Can I my current theme call in constructing In custom Magento extension?

texts:
public function _construct(){

     $this->loadLayout();
    $this->renderLayout();

}

public function indexAction(){

    $this->loadLayout();
    $this->renderLayout();

    echo "see My Controller";
}

When I am call layout in index controller the it will display the my cuttent theme. and when I call in _construct then it's display magento default theme. why?
can you explain ? how to set my current theme in _construct() function magento extension


texts:
I have a question regarding price filters in the layered navigation.

On a top level category page:

http://todayscyclist.co.uk/bicycle-accessories.html

The price filter is split into just two options, in £1000 increments.

On the next level, the price filter is more sensible:

http://todayscyclist.co.uk/bicycle-accessories/bags-baskets/backpacks.html

this time in £10 increments.

In the admin I have layered nav set as follows:

Price Navigation Step Calculation: Automatic
Display Price Interval as One Price: No
Interval Division Limit: 9

Can anyone explain why the top level category is only returning two options, and why it is incrementing in £1000s?