texts:
I have created a module that is more or less a CRUD app. One of the fields is for a file to be uploaded. When I edit one of the rows, it is requiring me to re-upload the file to save the edit.

Is there anyway to make that one field not required when editing an row?

Edit: Here is the code I am using to add the file upload control to the form

$fieldset->addField('filepath', 'file', array(
              'label'     => Mage::helper('batch')->__('Select PDF'),
              'required'  => true,
              'name'      => 'filepath',
    ));


texts:
I'm trying to import some products from one shop to another. To reach my goal i need to create configurable products. Create simple products are fine, but create configurable products are a pain (because it isn't documented).

Can someone teach me in the right direction?

I found this links (but this didn't work):

http://netzkollektiv.com/blog/configurable-products-mit-der-netzkollektiv-coreapi-extension-fur-magento/
http://www.bubblecode.net/en/2012/04/20/magento-api-associate-simple-products-to-configurable-or-grouped-product/

Thanks!


texts: Error in Payment methods: The following error(s) occurred: Some PayPal solutions conflict. Please re-enable the previously enabled payment solutions

texts:
I am getting this error in payment methods in Magento2.1.7 backend

  The following error(s) occurred: Some PayPal solutions conflict.
  Please re-enable the previously enabled payment solutions.

Any help would be appreciated.


texts: Magento 2: Disabled products are still visible in Frontend

texts:
I have disabled the product from admin panel but still the product are visible in the frontend.
Expectation: Product should not visible in frontend when disabled it via admin.
Actual Result: Products are visible in frontend though disabled in admin
At initial, our website mode is in multi store mode, now we have changed it on single store mode. Also, we have some of the custom product attributes and store view was set to Global.
Is that because of store view of product attributes?
Please guide


texts: Fatal error - Call to a member function count

texts:
I wish to copy this content :

app\design\frontend\base\default\template\catalog\navigation\left.phtl

<?php if (!Mage::registry('current_category')) return ?>
<?php $_categories = $this->getCurrentChildCategories() ?>
<?php $_count = is_array($_categories)?count($_categories):$_categories->count(); ?>
<?php if($_count): ?>

        <?php echo $this->__('Browse By') ?>

<?php echo $this->__('Category') ?>

                <?php foreach ($_categories as $_category): ?>
                    <?php if($_category->getIsActive()): ?>

                        <a href="<?php echo $this->getCategoryUrl($_category) ?>"<?php if ($this->isCategoryActive($_category)): ?> class="current"<?php endif; ?>><?php echo $this->escapeHtml($_category->getName()) ?> (<?php echo $_category->getProductCount() ?>)

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

<?php endif; ?>

In my custom toolbar :

app\design\frontend\mytheme\default\template\catalog\product\list\toolbar.phtml

But I getting fatal error:

  Fatal error: Call to a member function count() on a non-object in
  app\design\frontend\mytheme\default\template\catalog\product\list\toolbar.phtml

Thanks for your help.


texts: how to get following result by raw sql query?

texts:
I need to get result following way and need to store in same way.and I don’t want loop the product collection.Anyone have idea on this to get result with single query?

sku,name,price,created_at,descrption,qty

1    xxx  30      somedate,this is desc,10

2    yyy  40      somedate,this is desc,25

3    zzz  30      somedate,this is desc,10


texts: Magento2.1.7 : Newsletter subscription error?

texts:
When i add my email to and click on Subscribe button. I get following error

Something went wrong with the subscription.

can someone please help me on this issue?


texts: Magento 2: How can i reindex set in Reset mode programmatically

texts:
I just need to reset all indexing  programmatically without use of command.
Is there any way to do this .
Any idea please share.


texts: Create a cron job for importing csv files in magento 2

texts:
I am trying to schedule a cron job for importing csv files which consists of the product details. But the cron is not working. can anyone help me resolving this issue?

I am using the following code in crontab.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd">
<group id="default">
<job name="cron_csv" instance="Cron\Csv\Cron\Test" method="myCronFunction">
<schedule>* * * * *</schedule>
</job>
</group>
</config>

And this is my cron fuction :

public function myCronFunction()
{
    $file = fopen('var/import/test123.csv', 'r', '"'); // set path to the CSV file
if ($file !== false) {

require __DIR__ . '/app/bootstrap.php';
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);

$objectManager = $bootstrap->getObjectManager();

$state = $objectManager->get('Magento\Framework\App\State');
$state->setAreaCode('adminhtml');

// used for updating product stock - and it's important that it's inside the while loop
$stockRegistry = $objectManager->get('Magento\CatalogInventory\Api\StockRegistryInterface');

// add logging capability
$writer = new \Zend\Log\Writer\Stream(BP . '/var/log/import-new.log');
$logger = new \Zend\Log\Logger();
$logger->addWriter($writer);

$header = fgetcsv($file); // get data headers and skip 1st row

// enter the min number of data fields you require that the new product will have (only if you want to standardize the import)
$required_data_fields = 3;

while ( $row = fgetcsv($file, 3000, ",") ) {

    $data_count = count($row);
    if ($data_count < 1) {
        continue;
    }

    // used for setting the new product data
    $product = $objectManager->create('Magento\Catalog\Model\Product');
    $data = array();
    $data = array_combine($header, $row);

    $sku = $data['sku'];
    if ($data_count < $required_data_fields) {
        $logger->info("Skipping product sku " . $sku . ", not all required fields are present to create the product.");
        continue;
    }

    $name = $data['name'];
    $description = $data['description'];
    $shortDescription = $data['short_description'];
    $qty = trim($data['qty']);
    $price = trim($data['price']);

    try {
        $product->setTypeId('simple') // type of product you're importing
                ->setStatus(1) // 1 = enabled
                ->setAttributeSetId(4) // In Magento 2.2 attribute set id 4 is the Default attribute set (this may vary in other versions)
                ->setName($name)
                ->setSku($sku)
                ->setPrice($price)
                ->setTaxClassId(0) // 0 = None
                ->setCategoryIds(array(2, 3)) // array of category IDs, 2 = Default Category
                ->setDescription($description)
                ->setShortDescription($shortDescription)
                ->setUrlKey($url_key) // you don't need to set it, because Magento does this by default, but you can if you need to
                ->setWebsiteIds(array(1)) // Default Website ID
                ->setStoreId(0) // Default store ID
                ->setVisibility(4) // 4 = Catalog & Search
                ->save();

    } catch (\Exception $e) {
        $logger->info('Error importing product sku: '.$sku.'. '.$e->getMessage());
        continue;
    }

    try {
        $stockItem = $stockRegistry->getStockItemBySku($sku);

        if ($stockItem->getQty() != $qty) {
            $stockItem->setQty($qty);
            if ($qty > 0) {
                $stockItem->setIsInStock(1);
            }
            $stockRegistry->updateStockItemBySku($sku, $stockItem);
        }
    } catch (\Exception $e) {
        $logger->info('Error importing stock for product sku: '.$sku.'. '.$e->getMessage());
        continue;
    }
    unset($product);
}
fclose($file);
}
}


texts: Empty SOAP response for customer.list or order.list

texts:
Has anyone seen this before where Magento's order.list call returns valid SOAP Response Headers but an empty Response?

And the worst part is that subsequent calls with the same from/to range succeed, but upon the initial connection process (it executes 5 or 6 successful queries before failing), it fails consistently.

2013-03-06T19:01:30+00:00 DEBUG (7): message="Error Fetching http headers - full exception logged in exception.log, Soap last request and response logged in st.log"
2013-03-06T19:01:30+00:00 DEBUG (7): message="SoapClient::__getLastRequest(): <?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:Magento" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3
.org/2001/XMLSchema-instance" xmlns:ns2="http://xml.apache.org/xml-soap"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:call><sessionId xsi:type="xsd:string">SCRUBBED</sessionId><resourcePath xsi:type="xsd:string">order.list</resourcePath><args SOAP-ENC:arrayType="ns2:Map[1]" xsi:type="SOAP-ENC:Array"><item xsi:type="ns2:Map"><item><key xsi:type="xsd:string">updated_at</key><value xsi:type="ns2:Map"><item><key xsi:type="xsd:string">from</key><value xsi:type="xsd:string">2012-05-15 07:01:04</value></item><item><key xsi:type="xsd:string">to</key><value xsi:type="xsd:string">2012-06-24 19:01:04</value></item></value></item></item></args></ns1:call></SOAP-ENV:Body></SOAP-ENV:Envelope>
    "
2013-03-06T19:01:30+00:00 DEBUG (7): message="SoapClient::__getLastRequestHeaders(): POST /index.php/api/soap/index/ HTTP/1.1
Host: domain.com
Connection: Keep-Alive
User-Agent: PHP-SOAP/5.3.3
Content-Type: text/xml; charset=utf-8
SOAPAction: "urn:Mage_Api_Model_Server_HandlerAction"
Content-Length: 1023
Cookie: SERVERID=A;

"
2013-03-06T19:01:30+00:00 DEBUG (7): message="SoapClient::__getLastResponseHeaders(): HTTP/1.1 200 OK
Date: Wed, 06 Mar 2013 19:01:26 GMT
Server: Apache/2.2.15 (CentOS)
X-Powered-By: PHP/5.3.3
Content-Length: 2364630
Content-Type: text/xml; charset=UTF-8
"
2013-03-06T19:01:30+00:00 DEBUG (7): message="SoapClient::__getLastResponse(): "

I've got developer mode on, display errors on, logging on, and no exceptions are being logged on the SOAP Server side.   This test Magento instance has 3k customers and around the same number of orders.

I also tried the suggestion noted here (https://stackoverflow.com/questions/12906775/magento-soap-api-php-exception-thrown-for-login-method-call-looks-like-we-go) and that didn't fix it.

One unique thing about this particular Magento instance is that the customer created_at dates and order dates were randomized using a quick MySQL query using RAND() - as opposed to iterating over proper customer/customer models and setting the created_at dates and save()'ing, so I suppose it's possible because there's some kind of inconsistency internally in the customer entity.

I've seen the same issue occur with orders and customers, but the responses posted here are for the order.list query specifically.

When tested against a real Magento instance of roughly the same size, this did not occur.


texts: Where could I learn to edit page in magento 2?

texts:
I'm new in magento 2 and I would like to learn how to edit for example any pages (front.end) in magento 2:

Mysite.com/page1
Mysite.com/page2 ecc ecc

I'm studing from the doc of magento 2 (front-end) but are there other free resources? I have a new theme with parent Luma, but I would like to understend beeter all the system of layout, block and fallback of magento


texts: How to Display the Most viewed Products in HomePage on Magento 1.9.1.0

texts: I need to display the most viewed products on home page.without any plugin installation. please help me!


texts: Exception : Element 'referenceBlock', attribute 'htmlClass': The attribute 'htmlClass' is not allowed

texts:
what is the replacement for below code within xml

  htmlClass

I am getting this error :

Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'referenceBlock', attribute 'htmlClass':The attribute 'htmlClass' is not allowed.

this is the offending code:

  <referenceContainer name="product.info.media" htmlClass="ticket-media product media">
        <block class="Magento\Framework\View\Element\Template" name="eventticketimage" template="Magenest_Ticket::catalog/product/images.phtml"/>
    </referenceContainer>

and also this:

   <referenceBlock name="page.main.title" htmlClass="ticket-page-title
page-title" remove="true"/>


texts: Magento 2.1 - Change status and generate invoice automatically after inline payment received

texts:
i have only one  payment method with CB (paybox) and i want to automatically make some actions if  payment return succeed :

change the order's status to paid for example
generate the invoice associate and send it by mail

What is the best way to achieve that?


texts: EU cookie law solutions, opinions & experiences

texts:
The EU cookie law requires that many Magento websites will need an update to avoid fines. So far I have only seen extensions that have an accept-button and occasionally a deny-button, which leads the visitor away from the website. These options do not seem compliant with the EU cookie law and they also do not promote more sales.

Is there a good (generic) solution for the EU cookie law for Magento? If not, is it feasible to develop a generic solution for this?

Does anyone have any experience, solutions, opinions, etc. on this subject? It would be nice to have this page as a detailed guide to working with EU cookie law.


texts: Upload Image not working in firefox (Magento 1.9) frontend

texts:
I tried to upload some image product in frontend. Before, button browse and upload were missing, then I have upgraded the latest flash mozila (firefox) and then browse and upload button were there but when i choose some images and click button upload, the image cannot upload well, so why that is happen? can you tell me the solution ? this issue just only in mozila firefox, in chrome worked well.

Capture:


texts: How to hide form content from add product forms

texts:
I am working on Add Product section customization. Based on role I want to hide Some Fields from Price Tab form content and want to show other Fields instead of that.
Where are the files to hide fields.
The problem is mentioned in Image. Please go through it for concept clarification.
Thanks in Advance.


texts: Cart item images are not showing in Order summary

texts:
Currently, am adding the product programatically while moving from the Shipping -> Review & Payments and facing a problem. The added item image is not showing in the Order Summary other than this all information is displayed correctly. Kindly refer to the below screenshot.

I found that Magento 2 is showing the images using

  Magento_Checkout/js/view/summary/item/details/thumbnail.js

and the image source is taken from the window.checkoutConfig.

The reason for this issue is window.checkoutConfig information will be saved at the initial loading of the checkout and the saved data won't get updated until Refreshing the Page. But all other information are get updated correctly because those information are taken from the API carts/mine/shipping-information.

I can overcome the issue by including the image information with the same API. But I need to is there any other better solution?

And the same issue happens if am using two browser tabs.

Step 1: In the First tab am on the checkout page.
Step 2: In the Second tab am adding a product to cart.
Step 3: Then from the First tab am moving from Shipping -> Review & Payments. The same thing happens here.

I don't know wheater I can report it as Magento bug. Kindly confirm if you are sure that this one a Magneto bug. Thanks in Advance :)


texts:
Since my store has been updated to latest Magento 2.3.3 when I go to product page I got this error.

  temando.CRITICAL: "accountId" is required. Enter and try again.

I have tried Setup:Update, Di:Compile and a lot of other similar things to get this working but of no use.
I don't want to disable this module as I need it.
So anyone have any solution please put it here.


texts: How can I add the shipping estimate fields from the cart page on the mini cart?

texts:
In a theme based on rwd (magento ce 1.9.1), how can I add the shipping estimate from the cart page on the mini cart?

I already searched a lot and still couldn't find if that's possible or what's the best way to do that. Similar questions about shipping options seemed to me to be only about the cart, where the fields are already present.

I already tried updating mini cart with the local.xml, but I'm never quite sure how the blocks work, so I don't know if I did the right thing. Also, I don't know if that's supposed to work that way, as I only saw examples of adding custom stuff or removing block that already exist. Anyway, here's what I did:

<block type="checkout/cart_minicart" name="minicart.actions" as="minicart_actions" template="checkout/cart/minicart/itens.phtml" >
    <block type="cms/block" name="minicart.actions.shipping" as="shipping">
        <action method="setBlockId"><block_id>tab-product-shipping</block_id></action>
    </block>
</block>

This is based on some example I saw in a blog and it did not work.

What I want is that the client can estimate shipping directly on the mini cart, without the need to go to the cart page. I thought the best way is to provide a link that, when clicked, opens a popup with the shipping estimate fields that already exist on magento cart.

I was hoping to make this change without needing to change the core code, just using local.xml or editing items.phtml.

Any advice.


texts:
What's the best way to display the price of the product & display a price per kilo.

We have added in all the weight in grams so I suppose we could do the following

Price Per Kilo = (product price / weight in grams) * 1000

However wanted to see if there was a native way of doing this or a ready built extension


texts: Add content of static block as new tab to product detail page

texts:
I created 3 static blocks with just a random headline for now, where I want to add html content later.
the ids of the blocks are:

warranty
instructions
certificates

I then created 3 .phtml files with content like this ( will jsut add one because they all look the same):

<?php

echo $this->getLayout()->createBlock('cms/block')->setBlockId('warranty')->toHtml();

I placed all the three files in app/design/frontend/rwd/mytheme/template/catalog/product/view

so I have these files lying there:

warranty.phtml
instructions.phtml
certificates.phtml

Then I added this in app/design/frontend/rwd/mytheme/layout/local.xml:

<?xml version="1.0"?>

<layout>
    <catalog_product_view>
        <reference name="product.info">
            <block type="core/template" name="product.warranty" as="warranty" template="catalog/product/view/warranty.phtml">
                <action method="addToParentGroup"><group>detailed_info</group></action>
                <action method="setTitle" translate="value"><value>Garantie</value></action>
            </block>
            <block type="core/template" name="product.instructions" as="instructions" template="catalog/product/view/instructions.phtml">
                <action method="addToParentGroup"><group>detailed_info</group></action>
                <action method="setTitle" translate="value"><value>Anleitung</value></action>
            </block>
            <block type="core/template" name="product.certificates" as="certificates" template="catalog/product/view/certificates.phtml">
                <action method="addToParentGroup"><group>detailed_info</group></action>
                <action method="setTitle" translate="value"><value>Zertifikate</value></action>
            </block>
        </reference>
    </catalog_product_view>
</layout>

It doesn't work.
Nothing showing up on the product pages.
There are only the 3 tabs that have already been there before including one that seems to have been added the same way I just tried: (same code in .xml adding blocks to the detailed_info group and linking to a template.phtml file which is then using the same code as I do to call the static block.
But I must be missing some step in between because for me it doesn't work.What am I missing?

Edit: The part of the template/catalog/product/view.phtml where the output of the detailed_info group happens looks like this:

    <?php if ($detailedInfoGroup = $this->getChildGroup('detailed_info', 'getChildHtml')):?>

            <?php foreach ($detailedInfoGroup as $alias => $html):?>

<?php echo $this->escapeHtml($this->getChildData($alias, 'title')) ?>

<?php echo $html ?>

            <?php endforeach;?>

    <?php endif; ?>


texts: How to create plugin for observer Magento 2?

texts:
I have one Observer in my custom module.
I want to create Plugin for that observer.

How can I achieve that ?


texts: How to get magento root file path in controller in Magento 2?

texts:
How to get magento root file path in controller in Magento 2 ?
Like if my magento root file path is /var/www/html/magento in Controller file?


texts: Fatal error Mage_Shipping_Model Config.php on line 121

texts:
My store has this error on the shipping page, and it disables my ability to ship the product.  I tried disabling the modules related to shipping, and nothing happens.

Fatal error:  Call to a member function setId() on a non-object in /public_html/includes/src/Mage_Shipping_Model_Config.php on line 121

Is there a way to fix this?  I even tried reinstalling magento (didn’t clear the DB though), and still no luck.  Here’s what my shipping page looks like, the bottom doesn’t look like the html has been read: http://i.imgur.com/gOHmdui.jpg


texts: change main product image by select a image from image swatch

texts: i want to change the main image and more views images on product view page by select a image from image swatch or any name from drop-down please suggest me any extension which achieve this function thanks


texts: Magento 2: how to enable and disable customer?

texts:
I am looking for code how the customer can be enabled and disabled using customer Id in Magento 2.

When customer is disabled we should not allow customer to login from front end.

I tried setting is_active column as 0 in Database then also i can able to login from frontend.

I am using below code

  public function execute(){
     $user = $this->customerFactory->create();
        $userId = $this->getRequest()->getParam('user_id', false);
        $status = 0;
        if($userId):
          $user->load($userId)->setWebsiteId($oldUser->getWebsiteId());
        endif;
      try {
            $user->setIsActive($status);
            $user->save();
         }catch (\Exception $e){
           $this->_messageManager->addError(__('Can\'t save user'));
         }
  }

is that can be done pro grammatically?


texts: How to get RefererUrl in magento 2 observer?

texts:
How to get RefererUrl (source page url) in Observer file?

Actually by using this;

$this->_redirect->getRefererUrl();

I am getting Referer Url in magento 2 controller file.But in Observer file I am not getting the source url (RefererUrl).

Can you help me on this ?


texts: Magento system.log is filling up with errors

texts:
I do not see any obvious signs on the front end of my store however when I enable the system.log and exception.log I'm seeing A LOT of entries.

First, from the system log, I'm seeing the following error (and corresponding code that is being referenced):

2013-06-04T22:55:31+00:00 ERR (3): Notice: Undefined variable: name  in /home/XXXXXX/public_html/app/code/core/Mage/Page/Block/Html/Head.php on line 55

line 55: $this->addItem('skin_css', $name, $params);

2013-06-04T22:55:31+00:00 ERR (3): Warning: Missing argument 1 for Mage_Page_Block_Html_Head::addCss()  in /home/XXXXXX/public_html/app/code/core/Mage/Page/Block/Html/Head.php on line 53

line 53: public function addCss($name, $params = "")

2013-06-04T22:55:35+00:00 ERR (3): Notice: Undefined variable: gravdept_filterClass  in /home/XXXXXX/public_html/app/design/frontend/gravdept/acumen/template/catalog/layer/filter.phtml on line 38

echo '

getUrl().'">'.$_item->getLabel().'';

Then, in the exception.log, I'm seeing the following error over and over:

2013-06-04T23:01:14+00:00 ERR (3):
exception 'Mage_Core_Exception' with message 'Invalid block type: ' in /home/XXXXXXX/public_html/app/Mage.php:594
Stack trace:
#0 /home/XXXXXXX/public_html/app/code/core/Mage/Core/Model/Layout.php(495): Mage::throwException('Invalid block t...')
#1 /home/XXXXXXX/public_html/app/code/core/Mage/Core/Model/Layout.php(437): Mage_Core_Model_Layout->_getBlockInstance('', Array)
#2 /home/XXXXXXX/public_html/app/code/core/Mage/Core/Model/Layout.php(472): Mage_Core_Model_Layout->createBlock('', 'checkout.cart')
#3 /home/XXXXXXX/public_html/app/code/core/Mage/Core/Model/Layout.php(239): Mage_Core_Model_Layout->addBlock('', 'checkout.cart')
#4 /home/XXXXXXX/public_html/app/code/core/Mage/Core/Model/Layout.php(205): Mage_Core_Model_Layout->_generateBlock(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element))
#5 /home/XXXXXXX/public_html/app/code/core/Mage/Core/Model/Layout.php(210): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
#6 /home/XXXXXXX/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(344): Mage_Core_Model_Layout->generateBlocks()
#7 /home/XXXXXXX/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(269): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
#8 /home/XXXXXXX/public_html/app/code/core/Mage/Checkout/controllers/CartController.php(159): Mage_Core_Controller_Varien_Action->loadLayout()
#9 /home/XXXXXXX/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(419): Mage_Checkout_CartController->indexAction()
#10 /home/XXXXXXX/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index')
#11 /home/XXXXXXX/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#12 /home/XXXXXXX/public_html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#13 /home/XXXXXXX/public_html/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#14 /home/XXXXXXX/public_html/index.php(89): Mage::run('', 'store')
#15 {main}

Any ideas on how to fix these errors?


texts: Mage::getBaseUrl('media') returns url with http only in custom module

texts:
I have developed a module to make a custom menu to show thumpnail images of sub categories when hover the main menu or category.

For that in the Block of my module, I return the src of each thumpnail images using the following.

return Mage::getBaseUrl('media').$thumnail

As it returns the url scheme as http always, checkout page is not completely secure. So I changed it to return secure url as below

return Mage::getBaseUrl('media',true).$thumnail

Then it returns always https in it's url scheme.

I want https, only for checkout page since it needs to be secure, and http for other pages.
How to solve it?


texts: How to install php7 for Nginx, Magento 2?

texts:
I have a request for the installation php7 for Apache

sudo apt-get install -y php7.0 libapache2-mod-php7.0 php7.0 php7.0-common php7.0-gd php7.0-mysql php7.0-mcrypt php7.0-curl php7.0-intl php7.0-xsl php7.0-mbstring php7.0-zip php7.0-bcmath php7.0-iconv

What a complete request must be for Nginx?


texts: Magento 1.9: How do I know if my form is working? Handling post information

texts:
I was looking in implement a form that collect a customers name and email information by writing the information into a CSV file.

I'm completely new to Magento and got help with the following code via my previous question.

I've written a form for the frontend (second code below) but I'm have issues with the post data and how to handle it. I don't think the form is working because I'm not handling the information correctly.

As you can see I tried creating a CSV file named 'getfirmwarecustomerinfo.csv' in the module's controller (wasn't sure whether I was supposed to use $this->getRequest()->getPost() or $this->getRequest()->getParams().

The person who helped mentioned adding information mentioned I need code to validate post data and to save post data to CSV file.

app/code/local/Myname/Mymodule/controllers/IndexController.php

<?php

class Myname_Mymodule_IndexController extends Mage_Core_Controller_Front_Action {

    public function saveAction() {
        $postData = $this->getRequest()->getPost();
        //$params = $this->getRequest()->getParams();
        $file = fopen('getfirmwarecustomerinfo.csv', 'w');
        $info = array($postData['firstname'], $postData['lastname'], $postData['useremail']);
        fputcsv($file, $info);
        fclose($file);

        header("Content-type: text/csv");
        header("Content-disposition: attachment; filename = getfirmwarecustomerinfo.csv");
        readfile("getfirmwarecustomerinfo.csv");

        // afterwards, show a nice message & redirect the user to the previous page
        $session = Mage::getSingleton('core/session');
        if($success) {
            $session->addSuccess(Mage::helper('myname_mymodule')->__("IT WORKED"));
        } else {
            $session->addError(Mage::helper('myname_mymodule')->__("Something went wrong."));
        }

        $this->_redirectReferer();
    }
}

For the frontend, I found this piece of code from Inchoo. Most of the code is the same, I just added the <?php echo $this->getUrl('myname_mymodule/index/save', array('_secure'=>true)) ?> but I'm still not sure how the two files are connected?

app/design/frontend/base/default/templates/myname_mymodule/form.phtml

<form name="test-form" id="my-custom-form" action="<?php echo $this->getUrl('myname_mymodule/index/save', array('_secure'=>true)) ?>" method="post">
  <?php echo $this->__('First name') ?> *

  <input id="firstname" name="firstname" class="input-text required-entry" />

  <?php echo $this->__('Last name') ?> *

  <input id="lastname" name="lastname" class="input-text required-entry" />

  <?php echo $this->__('Email') ?> *

  <input type="text" name="useremail" id="useremail" class="input-text required-entry validate-email" />

  <input type="submit" name="submit" value="<?php echo Mage::helper('contacts')->__('Submit') ?>" />
</form>

Any explanation of what I'm doing wrong would be appreciated!


texts: Get Order Info at the ordering moment and send out invoice

texts:
I'm am improving Magento plugin that my friend wrote and I need to add a logic where I check each order and if the total sum is less than x then get this order details like total amount, name, address, phone number etc. And with these order details create XML and send out this XML to an external provider. At the same time send out to the customer the invoice and add to order comments in admin panel with some text like order placed from external provider. And do this only if the order total sum is less or equals than x.

I haven't done plugin from scratch myself, but the current plugin is made by a friend who due to some reasons can't continue and help me with that then I need to make it myself. What my current knowledge is that I know how to make additional tabs and fields in Admin -> Configuration. So there I currently have set up the field enable/disable the plugin and a text field make order from an external provider if the sum is less than x.

What I'm unfamiliar is how to observe all the going through orders? And get out the order total amount from that as well as order details I stated above. Also, I need to change the order status to processing and add a comment with my text. I guess the XML creation and sending out to the external provider is standard PHP task (use Varien/Zend in Magento) and is not related to Magento architecture.

Any tutorials for that, examples or your hints would be appreciated. I don't really want to dive deep into Magento architecture and read whole books, but just need to get this done. I tried to google about that but didn't get any good examples/tutorials maybe cause I don't write the problem in better Magento architecture/terms.


texts: How to setup same shipping rate group of countries

texts:
I have set up a Magento shop for my customer. He wants to set up shipping rates for group of countries not individual.
For eg. all Asia Pacific countries as below

weight    Price
1kg       $10
2kg       $15
3kg       $18

It would be great if you can help out

Thanks


texts: Magento2: How to show product video in Video tag insted of iframe

texts:
I need to show product youtube video in html Video tag. For example like this
Can someone know how to achieve this?


texts: Remove Attribute Set from conditions for Catalog Price Rule

texts:
Can anyone throw some light on how to remove 'Attribute Set' from conditions  for  "Catalog Price Rule" in the the admin section in a better way.

I can do the following thing.
In the class Mage_Rule_Model_Condition_Product_Abstract
I comment for attribute_set_id 'Attribute Set'

protected function _addSpecialAttributes(array &$attributes)
    {
        $attributes['attribute_set_id'] = Mage::helper('catalogrule')->__('Attribute Set');
        $attributes['category_ids'] = Mage::helper('catalogrule')->__('Category');
    }

But this is the abstract class so I can't extend this one.

So I need a better way to do this.


texts: How to see the guest-cart in the webpage

texts:
I successfully added a product with the api rest using and the access point '/rest/default/V1/guest-carts/:cart-id:/items'. Now, I need to show this guest-cart in the cart page of the client

Any idea?


texts: How to change product image for configurable products magento 2

texts: I am new to magento2, I couldn't understand How image swapping works for configurable product in magento 2. How this feature implemented programatically while we change options of configurable product.


texts:
Magento 1.9.1.1 with rwd theme. I'm trying to place the existing header minicart block (not the sidebar.phtml) within a cms page . I've tried using following

{{block type="checkout/cart_sidebar" template="checkout/cart/minicart.phtml"}}
and I get the icon and count but not the block content.


texts: Load icon spinning at new loaded product's detail page

texts:
I have an outstock furniture theme, so i customize it and turn it a techno store.But when i add a new product, i can not access its detail page, page waiting as loaded but load icon doesn't stop spinning.

Can anyone help what is the problems and solutions?


texts: Magento 2.2.1 - Custom Theme cannot be applied to second site

texts:
I've got a weird issue on my hands right now. I have created a custom theme, and I'm trying to apply it to one of my sites on Magento. There was not problem applying it to the first site(default), but when I tried to apply it to my second site it will not show up on the frontend.

In the backend it says that my custom theme is selected for all the sites, but the frontend is displaying the Luma theme. I have tried the following commands:

bin/magento cache:clean
bin/magento cache:flush
bin/magento setup:upgrade
bin/magento setup:static-content:deploy -f
bin/magento indexer:reindex

None of these have helped, it seems to be 'stuck' on the luma theme. Any suggestions on where to go from here would be greatly appreciated.

Thanks


texts: Magento 2 : What is the Best Way to Implement Favorite Products List for Regular Customer?

texts:
The majority of our customers not very tech savvy and have trouble with basic website functions and they need to order same or similar items every week or quickly.

What is best way for me to assign certain products to specific customers so they can quickly purchase them?  Like a favorites list.  shall I just rename the wish-list and use it?  Or is there a better way to achieve this?  Ideally I'd like them to be able to go one page where all their regular items are listed and at that page they will be able to enter that how many of each they want and then they can directly go to the checkout page.


texts: Is it possible to use separate DB for slow_backend cache?

texts:
I've tried the following local.xml conf without any luck:

<resources>
    <cache_db>
        <connection>
            <host><![CDATA[]]></host>
            <username><![CDATA[]]></username>
            <password><![CDATA[]]></password>
            <dbname><![CDATA[]]></dbname>
            <initStatements><![CDATA[SET NAMES utf8]]></initStatements>
            <model><![CDATA[mysql4]]></model>
            <type><![CDATA[pdo_mysql]]></type>
            <pdoType><![CDATA[]]></pdoType>
            <active>1</active>
        </connection>
    </cache_db>
</resources>
<cache>
    <slow_backend>database</slow_backend>
    <slow_backend_options>
        <connection>cache_db</connection>
    </slow_backend_options>
</cache>

I even tried defining connection directly in slow_backend_options like this:

<cache>
    <slow_backend>database</slow_backend>
    <slow_backend_options>
        <connection>
            <host><![CDATA[]]></host>
            <username><![CDATA[]]></username>
            <password><![CDATA[]]></password>
            <dbname><![CDATA[]]></dbname>
            <initStatements><![CDATA[SET NAMES utf8]]></initStatements>
            <model><![CDATA[mysql4]]></model>
            <type><![CDATA[pdo_mysql]]></type>
            <pdoType><![CDATA[]]></pdoType>
            <active>1</active>
        </connection>
    </slow_backend_options>
</cache>

Any ideas?

Thanks!


texts: Magento 2: How to Add another block in sales/invoice page.

texts:
i want to add another block in invoice page like (Another information tab), is there a way that i can display another block or override it.

here is a snapshot in which i want to add another block

Please suggest any solution.


texts: Force an order to go to the status complete

texts:
We are using a custom module that requires the status: "complete" (I can't change the module because it uses ioncube)

We are also using a payment system that doesn't offer the status option: "complete"

So my question is: How can I force an order to go to the status complete?

PS:
This doesn't work:

$order = Mage::getSingleton('sales/order');
$order->loadByIncrementId('12345');
$order->setState(Mage_Sales_Model_Order::STATE_COMPLETE, true);
$order->save();


texts: Cross sell products display in Addtocart popup

texts:
cross-sell products want to display in product view page addToCart Success popup.
Thanks in advance.


texts: How to change the store switcher default store selection

texts:
In my application I have 2 store view French and English, I have mentioned French as default one.

I just wanted to change it as, It should selected french automatically when admin logged in.

I checked it lot and nothing goes right I am not getting where and how I need to change the code.

Help me:)

Thanks In advance


texts: Magento2 Add Layout Handle Dynamically Depending On Product Attribute Catalog_Product_View

texts:
I have tried this with plugins and preferences and I seem to be missing the best practise method.

Why would Magento render the page so early that you can't modify the layout via plugin?

Am I missing something here?

I want to add an extra layout handle if the product has a certain attribute with x value. What is best practise here?


texts: Magento 2 - Which cache are required to be installed on server for best performance in Magento 2?

texts:
Magento 2 best performance which are the cache should be installed on the server for best performance of Magento 2 website in production mode?

Varnish/ Redis/ Memcache which one is best option to use together?

I have ubuntu server with LAMP installation as per Magento 2 requirement.

Any help will be appreciated.


texts: Magento 2 if we add header and footer in checkout page then payment method stop loading

texts:
I want to add header and footer on checkout page. To add that in my theme folder i copied  checkout_index_index.xml file i changed layout to 1column:

 <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

and added following code under body

    <referenceContainer name="footer-container" remove="false"/>
    <referenceBlock name="minicart" remove="false" />
    <referenceBlock name="top.search" remove="false" />
    <referenceContainer name="header.panel" remove="false" />
    <referenceBlock name="catalog.topnav" remove="false"/>

Now header and footers are showing but issue is payment method stopped loading on checkout page.  what could be the issue?

What am i doing wrong here?  Is there any other way to add header and footer on checkout page?


texts:
I'm attempting to translate the error messages returned by the Postcode Anywhere module. They're displayed in browser alerts, so are created in JavaScript.

I managed to translate one using the inline script method as below:

alert( Translator.translate(error) );

Translator.add('PostalCode Required', '<?php echo $this->__('Translated text here'); ?>');

I don't really like that though because it means I have inline JavaScript, and a translation held within a template file when all my other translations are held in the global locale folder. In an attempt to make this cleaner, I've tried to use the newer jstranslate method but I can't get it functioning correctly.

Edit: Here's a link to the tutorial I followed: http://en.herveguetin.com/translate-javascript-with-jstranslator-xml.html

I have a module config.xml defining a module like so (Client is used to replace the real name for privacy purposes):

<modules>
    <Client_PostcodeAnywhere>
        <version>0.0.1</version>
    </Client_PostcodeAnywhere>
</modules>

Inside the frontend -> layout sections of the config.xml file I have added:

<jstranslate>
    <file>jstranslator.xml</file>
</jstranslate>

Inside the frontend section of the config.xml I have added:

<translate>
    <modules>
        <client_postcodeanywhere>
            <files>
                <default>Client_PostcodeAnywhere.csv</default>
            </files>
        </client_postcodeanywhere>
    </modules>
</translate>

I have created the jstranslator.xml file in the same location as the module config.xml file:

<jstranslator>
    <client-postcodeanywhere-required translate="message" module="client_postcodeanywhere">
        <message>PostalCode Required</message>
    </client-postcodeanywhere-required>
</jstranslator>

I have created the Client_PostcodeAnywhere.csv file in my fr_FR folder within global locale folder (translating English to French):

"PostalCode Required","Translated text here"

I don't get a translation after doing this and I don't know why. Does anyone understand what the xml tags in the jstranslator file need to be? Mine is called 'client-postcodeanywhere-required' but I don't even know what that means.


texts: magento chooses Amazon pay to pay, When log in to the account without payment, return to the shipping interface, and then pay only Amazon pay,How to resolve


texts: How to apply only valid coupon codes to shopping cart programmatically?

texts:
I have a number of coupon codes which i want to apply to the cart programmatically.

I have done it like this:

foreach ($coupons as $coupon) //$coupons array of coupon codes
{
    Mage::getSingleton('checkout/cart')
        ->getQuote()
        ->setCouponCode($coupon)
        ->collectTotals()
        ->save();
}

Now what happens is that if the first coupon is valid, it got applied, but after that

if the second coupon is valid, it got replaced (first removed, second applied).
if the second coupon is not valid it removes the discount applied by the first coupon too.

Now I need help to tackle the situation as how to be able to apply both coupon/rules/discounts if valid (if possible applying two coupon codes)?
or not apply coupon code if not valid so that the coupon applied before doesn't got removed.


texts: Magento Multiple Sites from pointer domain

texts:
I have a Magento installation running having two websites by using sub domain for each
The structure is Like follows

Website 1 (Default)
  store 1
  store view 1
  URL: aus.beautyhq.testpad.com.au

Website 2
  store 2
  store view 2
  URL: nz.beautyhq.testpad.com.au
This structure is working perfectly,

Now i need to create beta versions of them which have to have the base url from different url
I have created the new websites

Beta Website 1 -> URL : beautyhq-aus.domain.com.au
Beta Website 2 -> URL : beautyhq-nz.domain.com.au

And created the
directories(Including index.php and .htaccess with necessary changes) on Magento root according to the codes of new websites.

The new domain is from a different server and is pointing to the IP of the server hosting my Magento installation.

Now when I set the base URLs of these websites, it redirects to the default one, but if I change the base URL to beautyhq.testpad.com.au/aus_beta/, it works perfectly.

I have tried the solution for pointer domains by modifying the .htaccess and using SetEnvIf and RewriteCond by referring this link
But it does not work.


texts:
I was trying to remove an Integration from Magento 2.2.7
in

  System => Extension => Integration

but unfortunately the delete icon (trash) is not clickable and i can't proceed
to remove the connection.


texts: Magento 1.9 - Significance of underscore in SCSS file names?

texts:
I have two questions (sorry if these seem insignificant I just like knowing the reasoning for things):

Why do some of the SCSS files in the new rwd theme have an underscore?
In the styles.scss file there are two imports, @import "framework" & @import "core" but the only files that have this name are _framework.scss and _core.scss - how does this import work when the file name is different?


texts: AJAX based "add to cart" for AJAX loaded products list?

texts: I created a list of products from AJAX response in phtml file. In that case default AJAX "ADD TO CART" is not working. Can anyone suggest me how I can create a ajax based add to cart for products list?


texts: Need to display a warning message if a product from a certain category is in the cart

texts:
I need to add a warning message to my shipping methods page in the cart if a product from a certain category has been ordered.

for example if our customer order furniture from the category ID 76 then i need a message to appear saying "Warning! delivery may take longer than the standard 2-5 working days" is this possible. I know i would need an IF statement i just dont know what to write in it or where to put it.

////////////ADDED/////////////

Exception.log

2013-08-27T14:11:26+00:00 ERR (3):
exception 'Mage_Core_Exception' with message 'Invalid block type: Mage_Catalog_Block_Product_List_Related2' in /home/senorehe/public_html/app/Mage.php:594
Stack trace:
#0 /home/senorehe/public_html/app/code/core/Mage/Core/Model/Layout.php(495): Mage::throwException('Invalid block t...')
#1 /home/senorehe/public_html/app/code/core/Mage/Core/Model/Layout.php(437): Mage_Core_Model_Layout->_getBlockInstance('catalog/product...', Array)
#2 /home/senorehe/public_html/app/code/core/Mage/Core/Model/Layout.php(472): Mage_Core_Model_Layout->createBlock('catalog/product...', 'content.product...')
#3 /home/senorehe/public_html/app/code/core/Mage/Core/Model/Layout.php(239): Mage_Core_Model_Layout->addBlock('catalog/product...', 'content.product...')
#4 /home/senorehe/public_html/app/code/core/Mage/Core/Model/Layout.php(205): Mage_Core_Model_Layout->_generateBlock(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element))
#5 /home/senorehe/public_html/app/code/core/Mage/Core/Model/Layout.php(210): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
#6 /home/senorehe/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(344): Mage_Core_Model_Layout->generateBlocks()
#7 /home/senorehe/public_html/app/code/core/Mage/Catalog/Helper/Product/View.php(73): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
#8 /home/senorehe/public_html/app/code/core/Mage/Catalog/Helper/Product/View.php(144): Mage_Catalog_Helper_Product_View->initProductLayout(Object(Mage_Catalog_Model_Product), Object(Mage_Catalog_ProductController))
#9 /home/senorehe/public_html/app/code/core/Mage/Catalog/controllers/ProductController.php(132): Mage_Catalog_Helper_Product_View->prepareAndRender(11342, Object(Mage_Catalog_ProductController), Object(Varien_Object))
#10 /home/senorehe/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(419): Mage_Catalog_ProductController->viewAction()
#11 /home/senorehe/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('view')
#12 /home/senorehe/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#13 /home/senorehe/public_html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#14 /home/senorehe/public_html/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#15 /home/senorehe/public_html/index.php(87): Mage::run('', 'store')
#16 {main}

System.log

2014-08-26T14:10:25+00:00 ERR (3): Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 9: parser error : Premature end of data in tag config line 2  in /home/senorehe/public_html/lib/Varien/Simplexml/Config.php on line 510
2014-08-26T14:10:25+00:00 ERR (3): Warning: simplexml_load_string() [function.simplexml-load-string]:  /config&gt;  in /home/senorehe/public_html/lib/Varien/Simplexml/Config.php on line 510
2014-08-26T14:10:25+00:00 ERR (3): Warning: simplexml_load_string() [function.simplexml-load-string]:          ^  in /home/senorehe/public_html/lib/Varien/Simplexml/Config.php on line 510

Thank you if you can help


texts: magento 2 multiple values drop down dependencies?

texts:
in magento 2 i have a drop down with the options 1, 2, 3, 4, 5, 6

when we  if '1' Test-1 and Custom-1 text fields want to show.
as well if i choose '2' Test-2 and Custom-2 text fields want to show respectively.

Please find the screenshots as shown below

Please suggest me and help me how to achieve this in magento 2 admin end?
thanks


texts: Adminhtml layout update xml breaks reindex page

texts:
Adding an adminhtml layout update breaks the re-index page here are my xmls.

The third file is an alternative for the layout update with nothing in, which still breaks the index page.

config.xml

<config>
    <adminhtml>
        <layout>
            <updates>
               <index>
                   <file>module/file.xml</file>
               </index>
            </updates>
       </layout>
    </adminhtml>
</config>

module/file.xml

<layout>
    <default>
        <reference name="notifications">
            <block type="module/adminhtml_notifications" name="module_notifications" template="company/module/notifications.phtml"/>
        </reference>
    </default>
</layout>

Still breaks with this:
module/file.xml

<layout>

</layout>


texts: Product Image Browse/ Uploading option not showing?

texts:
When I uploading the products images not showing and browse and uplaoding option also disabled in google chrome and opera mini. Its uploading images properly inside mozaila firefox browser.

I am new in magento. Please help me to resolve issue.


texts: If I have a store set up on 2.3 and I'm having issues getting it to update to 2.3.1 , what are the cons of not updating?


texts:
I have Magento2 website on production mode. And i have 8gb ubuntu 16.04 server. But i have checked ram memory uses 99% so my website is working slow.

Please any one tell me why used my memory 99%?

Which module take lots of memory in Magento?


texts: How to set default value for product custom option in Magento 2?

texts:
Can any one help me on how to set a default value for a product custom option, so that default value can be visible in product details page as default value.

Help would be appreciated.


texts: Magento 2 Templates: Use `$block` or `$this`?

texts:
In Magento 2, the $this variable no longer refereces to a template's block object.  It refers to a template class

 Magento\Framework\View\TemplateEngine\Php

However, this template class has a passthrough __call method

#File: vendor/magento/framework/View/TemplateEngine/Php.php
public function __call($method, $args)
{
    return call_user_func_array([$this->_currentBlock, $method], $args);
}

Which ensure any method calls make it through to the actual block.  This also explains why you can't call protected methods from phtml templates.

In addition to this though, every (I think?) template has a variable named $block populated, which also refers to the parent block object.  You can see this in use in Magento's list template

#File: vendor/magento/module-catalog/view/frontend/templates/product/list.phtml
//...
$_productCollection = $block->getLoadedProductCollection();

where the $block variable is used, but never explicitly defined.

Other than the differences mentioned above, is there any difference between using one technique over the other?  i.e. Do both $block and $this->currentBlock refer to the same object?


texts: How do i delete auto-generated coupon codes in magento?

texts: I would like to delete auto-generated coupon codes under shopping cart price rules in magento through script. can anyone please help me on this.


texts: How to add product progmatically in magento 2

texts: How can i add product using php scripts in magento base directory in magento 2, as Mage class has been eliminated ??


texts:
I have a radio button in the Product View page at the custom options, this contain Hide and Show. Is there any way to add a class for each option? I need to hide everything that is under this field when the value Hide is checked and to display when select Show. I try to use this but is work only for hide.

     jQuery('div:contains("Show")').on('click', function(){
       jQuery(this).closest('dd').siblings().show();
    });
     jQuery('div:contains("Hide")').on('click', function(){
       jQuery(this).closest('dd').siblings().hide();
    });

PHP code for generate radio buttons:

                       $selectHtml .= '
<input type="radio" id="options_' . $_option->getId() . '" class="'
                            . $class . ' product-custom-option" name="options[' . $_option->getId() . ']"'
                            . ($this->getSkipJsReloadPrice() ? '' : ' onclick="opConfig.reloadPrice()"')
                            . ' value="" checked="checked" />getId() . '">' . $this->__('None') . '
';
                    }


texts: Upgraded to 1.9.2, now get: PayPal Instant Payment Notification Warning

texts:
So I am not sure if this is related but I have upgraded to 1.9.2 recently from 1.9.1 and now get this:

Please check your server that handles PayPal Instant Payment Notifications (IPN). IPNs sent to the following URL(s) are failing:

https://www.domain.com/paypal/ipn/

If you do not recognize this URL, you may be using a service provider that is using IPN on your behalf. Please contact your service provider with the above information. If this problem continues, IPNs may be disabled for your account.

Any ideas?


texts: How to add category and subcategory link list to template

texts:
There are some days i try to find a working solution with magento 1.8

Please, i need to know how to create an expanded link list with all categories and subcategories. <ul><li> list.

Thank you!


texts: Magento2 Get Order API data in custom section

texts:
In Magento2, when we call order API

/V1/orders/:id method="GET",
magento uses *Magento\Sales\Api\OrderRepositoryInterface::get($id)*

which is defined in the *Magento\Sales\Model\OrderRepository::get($id)*,

So My question is, whenever I use either of the classes to fetch data similar to API response(json array) it returns PHP Object, so how can I receive the similar response.


texts:
My Magento 2.3 site is redirecting and I am unsure why. When I access the domain, it redirects to domain.com/Industrial%20Cleaning%20Products. I have done the following to try and rectify the issue:

Checked core_config tables
Set both base urls and secure urls through the admin panel
Set both base urls and sercure urls through the command line
Cleaned/flushed cache
Deleted all contents in the cache folders

Looking for any help as to where I should look/how I might be able to fix this?


texts: Magento2 on click any category from menu its give 404 error not showing its products or not going to listing page

texts: In Magento2 on click any category from menu its give error page not found and not showing its products or not going to listing page


texts:
I'm getting my active filters like this:

$filters = Mage::getSingleton('catalog/layer')->getState()->getFilters();

When $filters[0]->debug() I can tell the information I want, min/max values is saved in there, but I don't know how to access it.

The output looks like this (I deleted some meta information but maintained the original structure)

    array(4) {
  ["filter (Amasty_Shopby_Model_Catalog_Layer_Filter_Category)"]=>
  array(1) {
    ["layer (ModifiedLayer_Plugin_Model_Layer)"]=>
    array(2) {
      ["current_category (Mage_Catalog_Model_Category)"]=>
      array(20) {
        ["level"]=>
        string(1) "1"
        ["children_count"]=>
        string(2) "11"
        ["is_anchor"]=>
        string(1) "0"
      }
      ["state (Mage_Catalog_Model_Layer_State)"]=>
      array(1) {
        ["filters"]=>
        array(3) {
          ["0 (Amasty_Shopby_Model_Catalog_Layer_Filter_Item)"]=>
          string(17) "*** RECURSION ***"
          ["1 (Amasty_Shopby_Model_Catalog_Layer_Filter_Item)"]=>
          array(4) {
            ["filter (Amasty_Shopby_Model_Catalog_Layer_Filter_Decimal)"]=>
            array(4) {
              ["layer (ModifiedLayer_Plugin_Model_Layer)"]=>
              string(17) "*** RECURSION ***"
              ["attribute_model (Mage_Catalog_Model_Resource_Eav_Attribute)"]=>
              array(28) {
                ["entity_type_id"]=>
                string(1) "4"
                ["attribute_code"]=>
                string(10) "laenge_int"
                ["backend_model"]=>
                string(39) "catalog/product_attribute_backend_price"
                ["backend_type"]=>
                string(7) "decimal"
                ["store_label"]=>
                string(6) "Attribute"
              }
              ["max_value"]=>
              string(7) "55.0000"
              ["min_value"]=>
              string(7) "13.0000"
            }
            ["label"]=>
            string(12) "17 - 17"
            ["value"]=>
            string(5) "17-17"
            ["count"]=>
            int(0)
          }
        }
      }
    }
  }
  ["label"]=>
  string(19) "Label"
  ["value"]=>
  int(354)
  ["count"]=>
  int(0)
}

I should mention that I want a solution using magento functions and not some array accesses as far as possible.

Thanks


texts: Magento get media image size (file on server, no request)

texts:
for our slider we want to detect the image size/width to set the attribute correctly

Now we use

$_img = Mage::getBaseUrl('media') . $s['image'];
$_imgsize = getimagesize($_img);

Only recently realizing that this code generates a request via http

question: how can we get the imagesize through the server directly? (what do we need to feed getimagesize as directory) - or is there a better way?


texts: Magento Wysiwyg editor issue when try insert an image (probably js incompability)

texts:
I am having an issue while try to add an image using the Wysiwyg editor in Magento. The error I get is that the image upload tool displays with code (tags) on it and the upload or browse icon do not appears at all.

I am thinking it could be caused by a js compatibility issue. As I'm not a js developer, how could I check the issue this tool is showing up?

I am also thinking in replacing my wysiwyg js files with the original ones, but when I download the original magento installation files I don't see any js folder at all.

I need to solve this issue. Help much appreciated. Thank you in advance.
Regards - Yolanda


texts: Enable Search Suggestion option in Catalog Search

texts:
In Magento2 Docs, there is this article
http://docs.magento.com/m2/ee/user_guide/catalog/search-suggestions.html

There is a mention about Enable Search Suggestion.

But in Magento 2.2 Store -> Configurations -> Catalog -> Catalog -> Catalog Search there are only these options ( I've checked all scopes )

I've checked the system.xml file of search module on a clean installation and even github branches of Magento and it seems like these options exists only in docs.

  vendor/magento/module-catalog-search/etc/adminhtml/system.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
    <system>

            <group id="seo">
                <field id="search_terms" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
                    Popular Search Terms
                    <source_model>Magento\Config\Model\Config\Source\Enabledisable</source_model>
                </field>
            </group>
            <group id="search" translate="label" type="text" sortOrder="500" showInDefault="1" showInWebsite="1" showInStore="1">
                Catalog Search
                <field id="engine" canRestore="1">
                    <backend_model>Magento\CatalogSearch\Model\Adminhtml\System\Config\Backend\Engine</backend_model>
                </field>
                <field id="min_query_length" translate="label" type="text" sortOrder="5" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
                    Minimal Query Length
                    <validate>validate-digits</validate>
                </field>
                <field id="max_query_length" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
                    Maximum Query Length
                    <validate>validate-digits</validate>
                </field>
            </group>

    </system>
</config>

Do you have these options in your Magento2 Panel Admin?


texts: How to Display appropriate localisation based

texts:
I'd like to configure the Magento site to be able to recognize the default language and location of the user and display the site in that language and with appropriate localisation.

For example:

A user from India with Indian language as default will go directly to the Indian Language website with Rubles as the default currency and prices.

Is this possible? If so how?


texts: "Catalog Search indexer process unknown error: null" with Elasticsearch

texts:
After enabling Elasticsearch6+ as Catalog Search engine in Magento
  admin (M2.3.3) I'm receiving this error while reindexing:

  Catalog Search indexer process unknown error: null


texts: Can i use dataflow import to update products

texts:
I am really sorry for asking this. I feel like this is a stupid question, but honestly I have googled until the term googling has lost all meaning.

I just want to do a bulk update of product information, I do not want to add or import new products, just update the information for existing products. But all I seem to be able to find on google is articles referring to importing products into Magento. Perhaps my google-fu is failing me, and if this is the case I apologize, but I would be grateful if someone can just answer this really simple question.

I have a CSV file with updated product information.

I want to use this file to update the existing products in Magento 1.9.x.

Can this be done with importing?

Or will I have to build a script that reads the CSV file and manually updates each product?


texts: Magento 2: Radio option not sending the data on form submit in admin panel

texts:
Hi am using the following code to set the radio box value. But it is not working, Where as other form fields are working fine.

Code

$fieldset->addField(
            'gender',
            'radios',
            [
                'label' => __('Gender'),
                'title' => __('Gender'),
                'name' => 'gender',
                'required' => false,
                'values' => array(
                        array('value'=>'male','label'=>'Male'),
                        array('value'=>'female','label'=>'Female'),
                   )

            ]
        );

Code 2:

if (isset($postData['gender']))
     {
        echo 'is set'.$postData['gender'];
        exit();
     }
else {
        echo 'Not set';
        exit();
     }

It echo $$$ instead the gender value, when selected.

Thanks in advance.


texts: Magento 2 Perform catalog search in my custom table

texts:
Building a custom module where I need to search on the third-party table for data.

I have executed and filtered data from the third-party table and retrieve the entity_id from it and added the entity_id the below query.

$this->queryResponse = $this->searchEngine->search($queryRequest);
    $ids = [0];

    $productIds = $this->crossReferenceFactory->getProductIdsBySearch($this->queryText);

    if(count($productIds)>0){
        foreach($productIds as $id)
            $ids[] = $id;

    }
    /** @var \Magento\Framework\Search\Document $document */
    foreach ($this->queryResponse as $document) {
        $ids[] = $document->getId();
    }
    parent::addFieldToFilter('entity_id', ['in' => $ids]);

When I do such filter it lists the products perfectly fine, But when I query for words which exist only in the third-party table it doesn't build the layered navigation.

After debugging I come to know that layered navigation uses below method.

public function getFacetedData($field)
{
    $this->_renderFilters();
    $aggregations = $this->queryResponse->getAggregations();
    $bucket = $aggregations->getBucket($field . '_bucket');
    if (!$bucket) {
        throw new StateException(new Phrase('Bucket does not exist'));
    }
    $result = [];
    foreach ($bucket->getValues() as $value) {

        $metrics = $value->getMetrics();
        $result[$metrics['value']] = $metrics;
    }

    return $result;
}

So, When I search for any particular word it builds the layered navigation using queryResponse data.

My concern is how can I add my table to $queryRequest so that I can have a consistent result. Any help would highly appreciate.


texts:
I want to disable the place order button when they meets some condition and also it alert the message when the customer click the place order button.

Help me to finish my requirement.


texts: Magento 2 checkout - move Shipping methods block to Payment step

texts: can anyone help me in moving shipping methods block to payment step ? I dont have any idea,kindly help me


texts:
We have two shipping methods: package and postal. Postal is the cheapest.
We have shipping rules based on weight.
One of our products is large sheets of paper, because this cannot be send as postal we gave this product a high weight.
This works fine, when a large sheet of paper is ordered the package shipping method is selected.

Now we've added a custom option to the product, saying 'cut before sending'.
When the customer selects it, we will cut the large sheet of paper in 4 and send it as postal.
But how can we change the weight of the product when the 'please cut' option is selected? The package shipping method is still selected, but the postal method should be selected.


texts: Function to list all the email templates in a system (like getDefaultTemplatesAsOptionsArray)

texts:
I am trying to list all the email templates on a Magento installation for an extension I am working on. It currently uses the getDefaultTemplatesAsOptionsArray function but that does not list any custom templates that the user has added to the system.

I have been searching around and have not been able to find a reference for a function that would provide this.


texts: Magento2: What's the best way to add custom payment method field?

texts:
I've set up a new payment method in Magento 2 with a custom payment method field (like "po_number" from magento/offline-payment-methods). And front end is working perfectly fine (field showing up, validation, etc.).

However, if I want to place the order Magento the WebAPI request throws the following error:

"Property \"CustomField\" does not have corresponding setter in class \"Magento\Quote\Api\Data\PaymentInterface\".

It seems that Magento validates the custom field against the core payment interface where methods like getPoNumber and setPoNumber are defined.

I already tried to add the custom field via extension attributes:

<extension_attributes for="Magento\Quote\Api\Data\PaymentInterface">
    <attribute code="custom_field" type="Vendor\Module\Api\Data\MethodInterface[]" />
</extension_attributes>

and created the interface with the specific methods:

<?php
namespace Vendor\Module\Api\Data;
use Magento\Framework\Api\ExtensibleDataInterface;
interface MethodInterface extends ExtensibleDataInterface
{
    public function setCustomField($customField);
    public function getCustomField();
}

But this doesn't work. Magento still validates against the core payment interface.

The question now is, how to get Magento to accept the custom payment method field?
Any pointers are much appreciated :)


texts: Magento 2 - Create admin grid with two tables of different structures using UI Component

texts:
Need to create an admin grid on Magento 2 with data of two custom tables of different structures.

FYI, unable to proceed with joins and union.

Can you please anyone provide the best solution to achieve this?.


texts: Magento 2.3.2: Authorize.Net: An error occurred during processing. Please try again

texts: I'm trying to place order via Authorize.Net [Sandbox Account], but sadly I'm not able to, I'm getting error like: An error occurred during processing. Please try again. OR Error, message: code: "E00003", text: Root element is missing., also I'm getting some errors in console you can see those in below images.


texts:
I want to output the finalPrice in the swatches directly, so that customers can see what the options mean for the price. I am successful in outputting it, but somehow it doesn't index all the products. What I am having now is the following:
define([
    'jquery',
    'underscore',
    'priceUtils',
    'domReady!'
], function($, _, priceUtils) {

    function addPricesToOptions() {
        if (!$('[data-role=swatch-options]').first().data('mageSwatchRenderer')) {
            return setTimeout(addPricesToOptions, 500);
        }

        var config = $('[data-role=swatch-options]').first()
                .data('mageSwatchRenderer').options.jsonConfig;

        $('.swatch-attribute').each(function () {
            var attributeId = $(this).attr('data-attribute-id');
            $('.swatch-option', this).each(function () {
                var optiondId = $(this).attr('data-option-id');
                var index = _.findKey(config.index, function(value) {
                    return value[attributeId] == optiondId;
                });
                this.innerHTML += ' ' +
                    priceUtils.formatPrice(
                        config.optionPrices[index].finalPrice.amount,
                        config.priceFormat
                    ) +
                    '';
            });
        });
    }

    if ($('[data-role=swatch-options]').length) {
        addPricesToOptions();
    }
});

In my case it loads all attributeId's (93 + 150) and all optiondId's of the attributeId's (93: 4,7 150: 24,25,26), but it doesn't loop through all the combination of optionId's. To get an productId I need to combine the optionId's of the attributeId's, so for example option 4 of attribute 93 and option 24 of attribute 150 will give me productId 3. With the above script it will only loop through optionId 4 (4+24=3, 4+25=4, 4+26=5), but it should also repeat for optionId 7 (7+24=6, 7+25=7, 7+26=8). How can I loop through all combinations of the optionId's?


texts:
I am using below code for the most viewed products at home page, but My client keep complaining that these products were not updating.

$products = Mage::getResourceModel('reports/product_collection')
    ->addAttributeToSelect('*')
    ->addMinimalPrice()
    ->addUrlRewrite()
    ->addTaxPercents()
    ->addAttributeToSelect(array('name', 'price', 'small_image')) //edit to suit tastes
    ->setStoreId($storeId)
    ->addStoreFilter($storeId)
    ->addViewsCount();

    Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
    Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
    $products->setPageSize($this->getConfig('qty'))->setCurPage(1);

Please check and let me know what is the error


texts: Abandoned cart email is not sending to customer

texts:
we are using custom module for sending abandoned cart email to customers.

cron job is working fine in site as checked with AOE extenison.
 as in configuration , i waited for more than one day but still i didt got any abandoned cart email.

for checking module is working or not, i followed :

Set Dry Run to Yes
Set Test email to your test customer email
logged in as your test customer, add a product to your cart and log out
Go back to the backend in the module configuration page and click on the Send button

when i checked the /var/log/digitalpianism_abandonedcarts.log file, i found as below :

2016-07-04T11:13:37+00:00 DEBUG (7): DigitalPianism_Abandonedcarts_Model_Observer::_sendEmailssendAbandonedCartsEmail: kidsdial11@gmail.com
2016-07-04T11:13:39+00:00 DEBUG (7): DigitalPianism_Abandonedcarts_Model_Observer::_sendEmailssendAbandonedCartsEmail: kidsdial101@gmail.com
2016-07-04T11:13:40+00:00 DEBUG (7): DigitalPianism_Abandonedcarts_Model_Observer::_sendEmailssendAbandonedCartsEmail: kidsdial17@gmail.com

controllers

<?php

/**
 * Class DigitalPianism_Abandonedcarts_Adminhtml_AbandonedcartsController
 */
class DigitalPianism_Abandonedcarts_Adminhtml_AbandonedcartsController extends Mage_Adminhtml_Controller_Action
{
    /**
     * Check for is allowed
     *
     * @return boolean
     */
    protected function _isAllowed()
    {
        return Mage::getSingleton('admin/session')->isAllowed('system/config/abandonedcartsconfig');
    }

    /**
     * Manually send the notifications
     *
     * @return void
     */
    public function sendAction()
    {
        $model = Mage::getModel('abandonedcarts/observer');
        $model->sendAbandonedCartsEmail(true);
        $model->sendAbandonedCartsSaleEmail();

        $result = 1;
        Mage::app()->getResponse()->setBody($result);
    }
}


texts:
I used this tutorial http://www.demacmedia.com/magento-commerce/mini-tutorial-magento-newsletter-pop-up-with-cookie/

to create a cookie based popup that has the newsletter form, how can i place the magento registration form instead.


texts: Magento PayPal Express incorrect country

texts: We use the PayPal Express as a great way of letting customers checkout (via shopping cart shortcut). Everything is good, except that all the shipping address' countries are whatever our Merchant Country is (UK). So for example, a few minutes ago an order was placed in Germany. The Magento order confirmation show the country as being UK, but it should be Germany. The PayPal receipt has the same problem. But every single order outside the UK shows the UK as being the country, I doubt that it is a customer issue. How can this be fixed?


texts: Product Collection in custom class always use EAV tables

texts:
I have a very weird sutuation. My class is as simple as this:

<?php
namespace Vendor\Company\Helper;

class MyHelper
{
    protected $_productCollectionFactory;

    public function __construct(
        \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory
    ) {
        $this->_productCollectionFactory = $productCollectionFactory;
    }

    public function someMethod()
    {
        ...
        $productCollection = $this->_productCollectionFactory->create();
        $productCollection->addAttributeToSelect(['attr1','attr2', 'attr3']);
        echo $productCollection->load()->getSelect(); // SELECT `e`.* FROM `catalog_product_entity` AS `e`
    }
    ...
}

Note how raw collection query looks like: SELECT e. FROM catalog_product_entity AS e

I was expecting Magento to use product flat table, since I have catalog/frontend/flat_catalog_product = 1 in my database.

I tried to debug this, and figured out that this happens because Magento\Catalog\Model\Indexer\Product\Flat\State has $isAvailable = false as an argument. If I change this to true, by using virtual types magic, as explained here: https://magento.stackexchange.com/a/139334/26850

<virtualType name="enabledFlatState" type="Magento\Catalog\Model\Indexer\Product\Flat\State">
    <arguments>
        <argument name="isAvailable" xsi:type="boolean">true</argument>
    </arguments>
</virtualType>
<virtualType name="enabledFlatStateProductCollection" type="Magento\Catalog\Model\ResourceModel\Product\Collection">
    <arguments>
        <argument name="catalogProductFlatState" xsi:type="object">enabledFlatState</argument>
    </arguments>
</virtualType>
<virtualType name="enabledFlatStateProductCollectionFactory" type="Magento\Catalog\Model\ResourceModel\Product\CollectionFactory">
    <arguments>
        <argument name="instanceName" xsi:type="string">enabledFlatStateProductCollection</argument>
    </arguments>
</virtualType>
<type name="Vendor\Company\Helper\MyHelper">
    <arguments>
        <argument name="productCollectionFactory" xsi:type="object">enabledFlatStateProductCollectionFactory</argument>
    </arguments>
</type>

I was able to get the query that I wanted:

SELECT 1 AS status, e.entity_id, e.attribute_set_id, e.type_id, e.created_at, e.updated_at, e.sku, e.sku, e.attr1, e.attr2, e.attr3, e.temando_package_1_height FROM catalog_product_flat_1 AS e

But this is not what I want. I know that Magento should always use flat table for product collection if it was set like that in configuration.

My question is - what can cause Magento not to follow system configuration (flat tables turned ON)? What can possibly have impact on this?

P.S. I am using Magento 2.1.7.
P.S.S. Product collection on category pages works just fine, this is only for my custom class!


texts: Magento2 How to get current compare product collection on product list and product detail page?

texts:
I am using Magento2.3.1 and I need to list and detail page current product if add compare product than getting list and count on list and detail page. So I try to detail and list page checkbox with compare link click than product add and remove on one link.

If anyone this type of functionality working code share with and appreciated for help.

i share with u screen this type showing

Thanks,


texts: Export issue in grid collection when apply groupby in Magento 1.9

texts:
I am getting only 1000 rows in csv and excel when i am applying group by query in my collection
and also get wrong number of records in grid pager.

$collections->getSelect()->group('main_table.name');

If i am comment this line all works fine.

Let me know if you need more info.


texts: Magento : Categories Page Products Count Showing Wrong in Admin

texts:
I have totally added 1594 products in my Magento store. Here 806 products are enabled other 788 products are disabled.

In catalog->manage categories counting product shows wrongly see below image.

I have a Categorie called WHAT'S NEW it showing 817 products.
And Sub Categorie are

Bollywood Stars (99)
Fun & Funky (132)
Floral Rhapsody (51)
Charming Delights (98)

Here please count the sub categories totally 380. But in parent categories shows 817. How it comes...?

And I refer these links Link Here if I select Is Anchor no in view page PRICE, COLOR are hidden.

So how can I solve this counting problem..?


texts: Custom source model or attribute options

texts:
I have a few attributes that come with input select or multiselect. I have created source models to provide options for inputs. Everything seems to work (values are saved). But today I realized that also attribute options can be added.

Can anyone tell me what is the difference? Should I use source model or options? I have noticed thanks to this tutorial:
Upgrade script - Create new select attribute with options
that labels for options ar bind with store ids - how it should look like if I want to add the same options for every store (I have one website and one store). How to add more options for one attribute in sql script?


texts: Magento 2 -Google Tag Manager Enhanced E-commerce Tracking?

texts:
How to add Google tag manager Enhanced E-commerce tracking in magento2?
Could you please help me?


texts: Programmatically change 'parent_id' of category in Magento 2

texts:
How can I programmatically change the value of 'parent_id' in Magento 2?

I tried so far:

$category = $this->_objectManager->get('\Magento\Catalog\Model\Category')->load($id);
$d["entity_id"] = $id;
$d["name"] = $name;
$d["store_id"] = 0;
$d["parent_id"] = 7;
$category->setData($d);
$category->setStoreId(0);
$category->save();

Everything is saved except parent_id


texts: Magento 2.3.1 Not install sample data, need CMS code for LUMA home page

texts:
If we see from the demo here: http://demo-acm-2.bird.eu

There's banners and featured product at Home CMS which i don't get because sample data isn't installed

Is there another way to get the CMS code needed on this one page?


texts:
As many of you know there are multiple vulnerabilities that pertain to PHP 7.1, 7.2, and 7.3.
I currently run PHP 5.6 with Magento 1.7. I am pretty confident that 1.7 does NOT support any of the recent PHP 7.X versions.

What should be our next steps, is there a high risk of keep running PHP 5.6?

Sources:

https://www.cisecurity.org/advisory/multiple-vulnerabilities-in-php-could-allow-for-arbitrary-code-execution_2019-087/

https://support.magento.com/hc/en-us/articles/360033561271


texts: This error: "An error occurred while saving the attribute set 'happens when I try to save an existing attribute group

texts:
The same installation of magento works on my localhost. But now, the online version is giving this error.
I created new attributes and when I try to add them to a group of attributes and press the button 'Save group attributes', just get the error "An error occurred while saving the attribute set."

After disable and clear the cache of magento, delete the contents of var/cache and var/seasson, the error persists.

I look at the source code file in app\code\core\Mage\Adminhtml\controllers\Catalog\Product\SetController.php and saveAction() method noticed that the line $data = Mage::helper('core')->jsonDecode($this->getRequest()->getPost('data')); seems to be the problem, because it is returning an empty array. (line with red rectangle in the image below). causing the exception represented by the green rectangle in the image below.

No error log is being generated, and am using the 1.6.0.0 version of magento.


texts: Category Url's ended with numbers like car.html -> car-1.html

texts:
We have multiple stores in our magento website, few of the category Url's are ended with car-1.html and car-2.html.

From basic observation

   Admin category config - car.html
   store one - car-1.html
   store two - car-2.html
   store two - car-3.html

From Url rewrite

   Target Path --------- Request Path
   products/car.html --- catalog/category/view/id/1884
   products/car-1.html --- catalog/category/view/id/1884
   products/car-2.html --- catalog/category/view/id/1884

Can any one please tell me, Why the category url's are ended with strange numbers.


texts:
I was trying to override the price block for custom product type and I tried the below code, which is working fine but in base or some theme does not work.

    <reference name="catalog_product_price_template">
        <action method="addPriceBlockType">
            <type>packet</type>
            <block>packetprice/catalog_product_price</block>
            <template>packetprice/product/price.phtml</template>
        </action>
</reference>

Please advise.


texts: Is it safe keeping Supee patch files in root?

texts:
As question asks, is it safe to keep old patch files in root folder even after they are installed?
Can these patches somehow be initiated or uninstalled without SSH access?


texts:
I got accustomed to using PHPStorm's validation feature, the yellow flags on right of editor showing whenever a method could not be found.

I found that it doesn't recognize magic getter methods, for instance: $attribute->getAttributeCode().

Anyone ever made this work ?

Thank you.


texts: ArgumentCountError when executing indexer_clean_all_changelogs cron job

texts:
In Magento 2.2.6, I've encountered an issue and here is log:

main.CRITICAL: Error when running a cron job {"exception":"[object] (RuntimeException(code: 0):
Error when running a cron job at /usr/share/nginx/html/magento2/vendor/magento/module-cron/Observer/ProcessCronQueueObserver.php:324,
ArgumentCountError(code: 0): Too few arguments to function Magento\\Framework\\Mview\\View\\Changelog::clear(),
0 passed in /usr/share/nginx/html/magento2/vendor/magento/framework/Interception/Interceptor.php on line 58
and exactly 1 expected at /usr/share/nginx/html/magento2/vendor/magento/framework/Mview/View/Changelog.php:116)"} []

This error is coming from this cron job: indexer_clean_all_changelogs.
But not sure how to fix this. Does anyone know how to solve it or have the same problem?


texts:
I need to add a div inside the summary section. please guide me how to achieve the expected result. Also please check with below image to view summary section.

Thanks


texts:
I have the following questions.

1) Magento provides cron.php, shell/log.php & shell/indexer.php

And I have set them up as follows.These are just examples set up. These can be modified for the proper output/functioning/scheduling.

*/60 * * * * sudo /opt/lampp/bin/php /opt/lampp/htdocs/magento/shell/log.php clean >> /opt/lampp/htdocs/magento/var/log/cronlog.txt

*/60 * * * * sudo /opt/lampp/bin/php /opt/lampp/htdocs/magento/shell/indexer.php reindexall >> /opt/lampp/htdocs/magento/var/log/cronindexer.txt

*/60 * * * * sudo /opt/lampp/bin/php /opt/lampp/htdocs/magento/cron.php clean >> /opt/lampp/htdocs/magento/var/log/croncron.txt

Is this the correct set up, or only setting cron.php does the all things viz removing logs, performing indexing, cleaning up the cache, etc.

2) Magento provides the cron settings  in the back end also(system -> config -> system -> Cron (Scheduled Tasks) - all the times are in minutes) where we enter frequency for the tasks. By setting this option up again we need to go to option 1 described above. So what is the purpose of giving frequency/times in both cases(crontab & backend settings) and what times/frequencies will be taken into account.

I clearly do not understand this. Can anyone throw some light?


texts: Local Magento 2 broke after switching CSS rendering from server to client

texts:
I moved my Magento 2.3.3 instance from server to local. I used git to pull in the server, and ran composer install to get the magento files.

Everything worked well, until I went into admin and changes css rendering from server to client.
After that, I get the following error on the client side

1 exception(s):
Exception #0 (Exception): Notice: Undefined variable: template

and the admin doesn't have any css applied. The logs are full of Undefined variable" and "main.INFO: Broken reference".

I tried clearing and deleting the cache using cache:clean and cace:flush, I deployed the static content, and rebuilt the indexes. Nothing seems to be working.
I can still access the admin panel, but can't make any changes, and again, there's no css being applied.

Thanks


texts: Would it make sense to have Redis in a remote, different from the Magento store, server? I am mainly thinking that the communication (overhead) time might be equal (or more?) to Magento without Redis and so defeating the purpose of having it at all.


texts: How can I get the store code inside a block in the product page using the dependency injection?

texts:
I have to check which is the current store view. In order to do that I was using the Object Manager to get the store code like this:
$storeCode = \Magento\Framework\App\ObjectManager::getInstance()
    ->get(\Magento\Store\Model\StoreManagerInterface::class)
    ->getStore()
    ->getCode();

if ($storeCode === "en") {
   ...
};
if ($storeCode === "it") {
   ...
};

but doing this way in no more recommended, instead I should use the dependency injection technique...
how should I use it?


texts: Unable to translate message in magento 2

texts:
I want to translate quantity error message.

I changed in

  app/design/frontend/Smartwave/porto/i18n/fi_FI.csv

"We don't have as many ""%1"" as you requested.","Meillä ei ole pyytämääsi määrää tuotetta ""%1"".",module,Magento_CatalogInventory

and run php bin/magento setup:static-content:deploy fi_FI command
but it's not working


texts: Why is js breaking with requirejs in templates on Magento 2 and how to fix?

texts:
I am using a custom theme called Porto for Magento 2.

I have found an issue where when I load the page with dev tools enabled and having disable cache checked, a number of js errors pop up.

Most of the errors are one of:

Uncaught TypeError: $(...).swMegamenu is not a function
Uncaught TypeError: $(...).owlCarousel is not a function
Uncaught TypeError: Cannot read property 'timepicker' of undefined

The reason is that the libraries these function calls depend on are not loaded yet, but why is that surely requirejs would have ensured the function is only run once the js libraries have been downloaded.

Looking at one of the errors is:

<script type="text/javascript">
    require([
        'jquery',
        'Smartwave_Megamenu/js/sw_megamenu'
    ], function ($) {
        $(".sw-megamenu").swMegamenu();
    });
</script>

With template hints we track the code to: app/design/frontend/Smartwave/porto/Smartwave_Megamenu/templates/topmenu.phtml

So Smartwave_Megamenu/js/sw_megamenu is not loaded. When the function is called.

How can I fix this issue? As you have to reload the page once all the assets have been downloaded for the megamenu and owlslider etc. to actually work.

Update: The library is definitely loaded as when I:

console.log(require.defined("Smartwave_Megamenu/js/sw_megamenu"));

It returns true

After some more investigation it turns out that function is not defined in jquery at that point:

if(!$.isFunction($.fn.swMegamenu)) will fail

As in swMegaMenu.js extending jquery has not happened at that point:

$.fn.swMegamenu = function() {
        $(".navigation.sw-megamenu li.classic .submenu, .navigation.sw-megamenu li.staticwidth .submenu, .navigation.sw-megamenu li.classic .subchildmenu .subchildmenu").each(function(){
            $(this).css("left","-9999px");
            $(this).css("right","auto");
        });


texts: Magento automatically generate "core.XXXXX" file in server

texts:
I got Magento running on my main root (It's VPS Server).

Everyday core.XXXXX files are generated automatically and site goes down. I got this message "Your maximum disk usage quota has been reached".

Now my host says he has no clue what they about and says Magento is doing it cause to him its only my site creating the core files.

Screenshot : http://prntscr.com/8vsmio

One thing i tried already is : https://forums.cpanel.net/threads/after-apache-upgrades-core-files-are-filling-up-public_html.73416/

Has anyone any knowledge to this? i searched magento but all i found is some termination of a service on host causing this.


texts: Checking if an attribute exists within an array of loaded attributes

texts:
I have an array of makes and values printed as following:

$name='makemagento';
$attributeInfo = Mage::getResourceModel('eav/entity_attribute_collection')->setCodeFilter($name)->getFirstItem();
$attributeId = $attributeInfo->getAttributeId();
$attribute = Mage::getModel('catalog/resource_eav_attribute')->load($attributeId);
$attributeOptions = $attribute ->getSource()->getAllOptions(false);
print_r($attributeOptions);

array($attributeOptions);

This gives me a list of results like this:

Array
(
[0] =&gt; Array
    (
        [value] =&gt; 1035
        [label] =&gt; Alfa Romeo
    )

)

I am trying to check if a value exists.

I do the following:

if (in_array('Alfa Romeo', $attributeOptions['label']))
 {
 echo "Match found";
 }
 else
 {
 echo "Match not found";
 }

But i can't seem to successfully get a "match found" result from this.

Can anybody advise?


texts:
I have 3 currencies setup on my page GBP, EUR and USD.

The default is USD.
When I click on either GBP or EUR currency the page reloads but stays on USD, also all prices stay on USD.

I have tried to empty the cache and reindex but both won't help.

I don't know what to look for now, anyone have a pointer what could be the issue?


texts: Is it OK to make all XML changes in a singe file in Magento 2.x?

texts:
In my /app/design/frontend/VENDORNAME/THEME/Magento_Theme/layout/default.xml I have made changes like this (changes that are effecting Magento_Catalog):

<move element="product.info.media" destination="content" before="product.info.main"/>
<referenceBlock name="product.attributes" remove="true"/>

It seems to work. The question is if it's bad in any way?

I would prefere to have a single file for all XML changes.


texts: How to remove review summary field in product review form in magento 2

texts: I need to remove review summary field in product review form.I have modified the core review form in my custom form. But Now, I need to remove validation for review summary field in Product review form. Please provide me a solution


texts: New Order statuses in the mass action update menu in Orders / Sales?

texts:
I am using Mangeto 1.9. I want to display in this menu: URL of the page:

www.yourmagento.com/index.php/admin/sales_order/index -

This is the orders view page, where you can see all your orders.

In this menu I want to display all custom created Order Statuses.
Here is a screenshot from my Order Statuses page:

I found that all statuses are displayed in the Order View page under the History tab . Take a look:

I found the file which is answering for the mass "Actions" menu and adding options in there.

Its' located here:

/public_html/beta/app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php

That's the code for 3 options in select menu:

    $this->getMassactionBlock()->addItem('pdfshipments_order', array(
         'label'=> Mage::helper('sales')->__('Print Packingslips'),
         'url'  => $this->getUrl('*/sales_order/pdfshipments'),
    ));

    $this->getMassactionBlock()->addItem('pdfcreditmemos_order', array(
         'label'=> Mage::helper('sales')->__('Print Credit Memos'),
         'url'  => $this->getUrl('*/sales_order/pdfcreditmemos'),
    ));

    $this->getMassactionBlock()->addItem('pdfdocs_order', array(
         'label'=> Mage::helper('sales')->__('Print All'),
         'url'  => $this->getUrl('*/sales_order/pdfdocs'),
    ));

I am showing you the code for only 3 of them, I think there is no need to show all and make this post more largest then needed.
From this code I understand that I have to write code for every custom order state.

My first question is: Is it possible to display all newly created order statuses automatically in this menu like it's happen in the menu of Order View page in the history tab.

I found the code which is answering for the options in the order view page in the history tab and there it is:

/public_html/beta/app/design/adminhtml/default/default/template/sales/order/view/history.phtml

and here is the code in this file which is calling the options:

        <select name="history[status]" class="select" id="history_status">
        <?php foreach (Mage::getSingleton('sales/order_config')->getStatuses() as $_code=>$_label): ?>
            <option value="<?php echo $_code ?>"<?php if($_code==$this->getOrder()->getStatus()): ?> selected="selected"<?php endif; ?>><?php echo $_label ?></option>
        <?php endforeach; ?>
        </select>

With this code all custom created Order statuses are displayed automatically in this page.

My second question is how I can make the same thing but for the mass Action select menu in the Orders / Sales page ? Is it possible ?

Thanks in advance!


texts: How to get current customer in external file

texts:
In my module i have a php file which is called by an Ajax Post, after a user has clicked on a link.
Now i need the customer-ID of that user who has clicked on this link.

    require_once("../../../../../Mage.php");
    umask(0);
    Mage::app();
    Mage::getSingleton('customer/session')->isLoggedIn()

Returns false at the same time at my phtml file with the same code it Returns true. I have tried other ways like

       Mage::getSingleton('core/session', array('name' => 'frontend'));
        if((Mage::getSingleton('customer/session')->isLoggedIn())) {
            $productPriceString = "true";
        } else {
            $productPriceString = "false";
        }

or even

    define('ROOT',Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB));
    $coreSession = Mage::getSingleton('core/session', array('name' => 'frontend'));

    if(isset($coreSession['visitor_data']['customer_id'])){
        $customerId = $coreSession['visitor_data']['customer_id'];
    } else {
        header('Location: '.ROOT.'customer/account/login/');
    }

    Mage::getSingleton('customer/session')->loginById($customerId);

    $customerSession = Mage::getSingleton("customer/session");
    if(!$customerSession->isLoggedIn()) {
        header('Location: '.ROOT.'customer/account/login/');
    }

But the result was always the same. So my question how can i get the id or even the _Customer object.

Thanks

EDIT

$session= Mage::getSingleton("core/session");

The result in my phtml file is object(Mage_Core_Model_Session)#125 (8)
But the result in my external php file is object(Mage_Core_Model_Session)#145 (8)


texts: How to get my custom table data from magento 2

texts:
I have created a new table using custom module and stored value to this table, now, i need to get table data in block php file from database in magento 2, How to achieve this?

TableName="email_format" columns="customerid" and "format" now,  i need to retrieve customer id and format value from table.

Thanks,