texts: css/html development for checkout process

texts:
I have created a theme and would like to finish it by styling the checkout and payment pages. Which trick can I play to have a »quick-access« to all these pages without the need of »buying« a product and entering all the necessary information? Is there any way to »short-circuit« this process?

Thanks in ahead!


texts:
On the catalog product list view I can use shuffle() on the product collection however it only shuffles a small proportion (e.g. 10) of the full collection (hundreds). There is also infinite ajax scroll on this page. The shuffled products are those on the first 'page' before the scroll loads more.

$_productCollection=$this->getLoadedProductCollection();
....
$items = $_productCollection->getItems();
shuffle($items);
foreach ($items as $_product):
....

Is there any way I can keep the scrolling feature but shuffle the full collection?

One way to shuffle all products is the following, but this takes an age to load and has no scrolling.

$_productCollection = $this->getLoadedProductCollection();
$_productCollection->clear();
$_productCollection->setPage(1,99999);


texts: Disable Recently Ordered / Reorder Block in Magento 2

texts:
How can i disable Recently order or Reorder block in magento 2?

In css i can hide the block "block block-reorder" by display:none;

But I want to fully disable it.


texts: magento 2.1 grid on custom tab of admin product edit page

texts:
I am trying to create a grid that should be shown on clicking a custom tab of admin catalog edit page.

1. Created catalog_product_new.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
    <referenceBlock name="product_form">
        <block class="Vendor\Module\Block\Adminhtml\Product\Edit\Tab\Customtab" after="review" name="product.customtab" as="customtab" >
            <arguments>
                <argument name="config" xsi:type="array">
                    <item name="label" xsi:type="string" translate="true">Custome Tab</item>
                    <item name="collapsible" xsi:type="boolean">true</item>
                    <item name="opened" xsi:type="boolean">false</item>
                    <item name="sortOrder" xsi:type="string">5</item>
                    <item name="canShow" xsi:type="boolean">true</item>
                    <item name="componentType" xsi:type="string">fieldset</item>
                </argument>
            </arguments>
        </block>
    </referenceBlock>
</body>

2. Created Customtab.php

<?php
namespace Venodr\Module\Block\Adminhtml\Product\Edit\Tab;

use Magento\Backend\Block\Template\Context;
use Magento\Framework\Registry;

class Customtab extends \Magento\Framework\View\Element\Template {

    protected $_template = 'catalog/product/edit/sample.phtml';
    protected $_coreRegistry = null;
    protected $_customtabFactory;
    public function __construct(
    Context $context, Registry $registry, \Vendor\Module\Model\CustomtabFactory $customtabFactory, array $data = []
    ) {
        $this->_coreRegistry = $registry;
        $this->_customtabFactory = $customtabFactory;
        parent::__construct($context, $data);
    }
    public function getProduct() {
        return $this->_coreRegistry->registry('current_product');
    }
    public function getCustomData($item_id) {
        $model = $this->_customtabFactory->create();
        $modelData = $model->getCollection();
        $modelData->addFilter('item_id', array('eq' => $item_id));

        $data = $modelData->getData();
        return $data;
    }
}

3. Created sample.phtml

$product =  $block->getProduct();
$item_id = $product->getId();
$customdata =  $block->getCustomData($item_id);
foreach ($customdata as $key => $data) {
     echo $data['title'];  echo $data['created_time'];
}

By this way I am able to show my custom Tab on Admin catalog edit page , which shows sample.phtml content. But, I want to show grid instead of sample.phtml

Can anyone provide me the steps to show grid on custom tab created in catalog_product_new.xml ?


texts: Products are not displaying less than 100

texts:
I'm trying to display products which are less than rs:100  using product list widget, but it is showing error. Can anyone help me?
Thanks in advance,

Result is like this :


texts: Observer not working, string output shows only {"_eavConfig":{}} as value

texts:
This is the code for my observe class, and it is working for the right event as I added a messageManager notice that appeared after the event.

All I want is the order information, I want the address. Am I doing anything wrong here?

    <?php

    // Get proper class to extend.

    namespace Website\SalesTracker\Observer;

    use Magento\Framework\Event\ObserverInterface;

    /**
    *
    */
    class TrackOrder implements ObserverInterface
    {

        protected $_messageManager;

        public function __construct(
            \Magento\Framework\Message\ManagerInterface $messageManager
        )
        {
            $this->_messageManager = $messageManager;
        }

        public function execute(
            \Magento\Framework\Event\Observer $observer
        )
        {
            $order = $observer->getEvent()->getOrder();

            $string = json_encode($order);
            $string .= 'Working?';
            file_put_contents('/debug-data2.txt', $string);
            // var_dump($observer->getOrder());
        }
    }

Here is my events.xml file

    <?xml version="1.0"?>

    <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
        <event name="sales_order_place_after">
            <observer name="sales_order_track" instance="Website\SalesTracker\Observer\TrackOrder" />
        </event>
    </config>


texts:
As we have follow all steps to increase magento 2 speed like Advanced bundling, minify js and css but still we face speed issue in the admin.

Our admin take too much time to load grid as well as if redirect from one page to another page its simply loading and loading.

What is the issue here? We have installed Light mage cache in our server as we uses Light speed server.

Please give some suggestion.


texts: Magento2: How to get current URL in XML file?

texts:
I am looking for current URL in XML.
Need to set canonical tag.

<head>
  <link rel="canonical" src="I want currentUrl here" src_type="url"/>
</head>


texts:
My Magento 2 not load CSS in frontend.

If I do php bin/magento setup:static-content:deploy, the problem is solved and load perfectly, but when I do setup:upgrade, CSS not load again.

I know that setup:upgrade remove the content generated to CSS.

Why?


texts: Magento 2 How Payment and Shipping Works!

texts:
I have some doubts about how this works can someone who has experience with any, preferably Braintree payment method and DHL or UPS Shipping Methods.

1- When Payment is send to Braintree and is success does Braintree update the order status in Magento?

2- DHL or UPS Shipping, when and order is created does the order get send to DHL or UPS to process at the time of purchase, and do they also update the order status in Magento?


texts:
I am working on Magento2.2.1, I want to sort by rating. I have applied the below code but it's not working with Ajax neither Page load as well. Pagination is not coming.

$collection->getSelect()->joinLeft(
                            'rating_option_vote_aggregated',
                            'e.entity_id = rating_option_vote_aggregated.entity_pk_value',
                            array('vote_count' => 'SUM(rating_option_vote_aggregated.vote_count)'))
                    ->group('e.entity_id')
                    ->order('vote_count ' . $this->getCurrentDirectionReverse());

Can anyone please suggest


texts: Guest can't create product programtaically [ similar to wishlist ]

texts:
If the Registered user click on "save design" button we are  creating new product.

Issue : But if guest user click on "save design" button, we are displaying pop up box to register or login. once guest user logged in, **new Product is not creating****

controllers

protected function _createProduct($type, $doSave=true, $originalProduct, $newImagePath="")
{
        $product = Mage::getModel('catalog/product');

        $product->setName($originalProduct->getName());
        $product->setDescription('what ever you need here');

        $customerId = Mage::getSingleton('customer/session')->getCustomerId();
        $product->setCreatedByCustomerId($customerId);

        if ($doSave)
            $product->save();

        return $product;
    }

Edit

Now we can able to create new product once guest user click on button, but guest user is not logged in and we need to assign the Created product to Guest user similar to Registered user

<?php if (!Mage::getSingleton('customer/session')->isLoggedIn()): ?>

            <?php echo $this->__('Login into your Account 4') ?>

       <form action="<?php echo $this->getUrl('example/amasty/createSimpleProductAndRedirect', array('_secure'=>(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS']==='on'), 'id' => Mage::registry('current_product')->getId())) ?>" id="ajaxlogin-login-form">
            // form code login/Register in pop up box
        </form>

<?php endif; ?>


texts:
I have changed option in Magento to show only products which are in stock. Configuration -> Catalog -> Inventury. DISPLAY OUT OF STOCK PRODUCTS is set to "NO"

On my front/index page I use bellow code to display randomly 5 products from same category.

<?php
$products = Mage::getModel('catalog/product')->getCollection();
$products->joinField(
'qty',
'cataloginventory/stock_item',
'qty',
'product_id=entity_id',
'{{table}}.stock_id=1',
'left'
);
$products->addAttributeToSelect(array('name', 'thumbnail', 'price', 'special_price' , 'RegularPrice' ));
$products->joinField('category_id', 'catalog/category_product', 'category_id', 'product_id=entity_id', null, 'left' );
$products->getSelect()->limit(5);
$products->getSelect()->order('RAND()');
$products->addAttributeToFilter('category_id', array('in' => array(5)));
$this->_reviewsHelperBlock = $this->getLayout()->createBlock('review/helper');
foreach ($products as $product)  :
?>

Above code displays products which are in stock and products which are out of stock.

What I would like to accomplish is to display products which are only in stock. I have tried to do this in so many different ways but have not succeeded.


texts: Quantity as filter in layered navigation

texts:
How to make product Quantity wise filter in layered navigation.

See image


texts: Most Product Views by last day and last month with views

texts:
I am trying to get most viewed products for last month and last day by using this code but apparently both are returning me same no. of views

Last Day:

$from = date('Y-m-d', strtotime(' -1 day'));
            $to=now();

Last Month:

 $from  = new DateTime("first day of last month");
            $to = new DateTime("last day of last month");

             from ->format('Y-m-d'); // 2012-02-01
            $to->format('Y-m-d'); // 2012-02-29

CODE:

 $productCount = 5;
          $storeId = Mage::app()->getStore()->getId();
           $products=Mage::getResourceModel('reports/product_collection')
                    ->addAttributeToSelect('*')
                    ->setStoreId($storeId)
                    ->addStoreFilter($storeId)
                    ->addViewsCount()
                    ->addViewsCount($from, $to)
                    ->setPageSize($productCount);

            Mage::getSingleton('catalog/product_status')
                    ->addVisibleFilterToCollection($products);
            Mage::getSingleton('catalog/product_visibility')
                    ->addVisibleInCatalogFilterToCollection($products);
            return $products;

Along with this I also need to get product view count for all the time.

EDIT: With certain fixes in my phtml file above code works for last day and all time. But the last month is giving me error on this line

->addViewsCount($from, $to)


texts: Magento custom attribute over the REST API

texts:
I tried to get full list of order item attributes by this url: api/rest/orders/25/items . There are:

    "item_id": "62",
    "parent_item_id": null,
    "product_type": "simple",
    "sku": "89110065",
    "name": "Diamond Glow Nourishing Mud Mask",
    "qty_canceled": "0.0000",
    "qty_invoiced": "0.0000",
    "qty_ordered": "1.0000",
    "qty_refunded": "0.0000",
    "qty_shipped": "0.0000",
    "price": "277.3100",
    "base_price": "277.3100",
    "original_price": "330.0000",
    "base_original_price": "330.0000",
    "tax_percent": "19.0000",
    "tax_amount": "52.6900",
    "base_tax_amount": "52.6900",
    "discount_amount": "0.0000",
    "base_discount_amount": "0.0000",
    "row_total": "277.3100",
    "base_row_total": "277.3100",
    "price_incl_tax": "330.0000",
    "base_price_incl_tax": "330.0000",
    "row_total_incl_tax": "330.0000",
    "base_row_total_incl_tax": "330.0000"

If you look at the order item object, you will see that it has more attributes. Is it possible to add a custom attribute to this list? Or I have to overwrite the existing API to add a custom attribute?


texts: Adding a CheckBox to the Frontend Login - Magento 2.1.9

texts:
We would like to add a checkbox to the frontend login in order to redirect that login to the admin login in case the checkbox is checked. The redirection would login them in the backend login and grant them acces to the backend.

But mainly, and to start off we would like to get that checkbox online.

It should appear on the green rectangle:

I have overwritten: \vendor\magento\module-customer\view\frontend\templates\form\login.phtml with \app\design\frontend\<custom-vendorname>\<custom-themename>\Magento_Customer\templates\form\login.phtml.

And the code overwritten:

        <?php echo $block->escapeHtml(__('Registered Customers')) ?>

        <form class="form form-login"
              action="<?php echo $block->escapeUrl($block->getPostActionUrl()) ?>"
              method="post"
              id="login-form"
              data-mage-init='{"validation":{}}'>
            <?php echo $block->getBlockHtml('formkey'); ?>
            <fieldset class="fieldset login" data-hasrequired="<?php echo $this->helper(\Magento\Framework\EscapeHelper::class)->escapeHtmlAttr(__('* Required Fields')) ?>">

                    <input type="checkbox" data-validate="{required:true}" name="custom-terms" title="<?php /* @escapeNotVerified */ echo __('Dealer access') ?>" id="register-input-custom" class="checkbox">

                    <?php echo __('Mark this if you want to access as a dealer. ') ?><a href="<?php echo $this->getUrl('redirection');?>">

            </fieldset>
        </form>

I have run these commands:

   rm -rf pub/static/*;
   php bin/magento setup:upgrade;
   php bin/magento setup:static-content:deploy;
   php bin/magento setup:static-content:deploy es_ES;


texts: how to create csv file for attribute and how to add attribute using csv file programmatically in magento 2

texts:
how to add csv file here

$eavSetup->addAttribute(
            \Magento\Catalog\Model\Product::ENTITY,
            'test_attribute',
            [
                'type' => 'int',
                'backend' => '',
                'frontend' => '',
                'label' => 'Test Attribute',
                'input' => '',
                'class' => '',
                'source' => '',
                'global' => \Magento\Catalog\Model\ResourceModel\Eav\Attribute::SCOPE_STORE,
                'visible' => true,
                'required' => false,
                'user_defined' => false,
                'default' => 0,
                'searchable' => false,
                'filterable' => false,
                'comparable' => false,
                'visible_on_front' => false,
                'used_in_product_listing' => true,
                'unique' => false,
                'apply_to' => ''
            ]
        );


texts: How to remove coupon from payment dive after clicking order summary discount code close button in magento2?

texts:
I have made custom discount remove button on checkout order summary.
coupon removed successfully but how to refresh payment div discount box code
after removing coupon?

order summary:

payment div:


texts:
I set a tax zone for Poland. if I choose a country when ordering: Poland then correctly applies 23% tax.

If I choose a different country, then I do not add anything.

How to set the same tax rate (23%) for all countries?


texts: Optimise URL when changing Store and language switcher to maintain SEO standards

texts:
I want to optimize the store view URL to maintain the SEO standards when switching the language view in Magento1.9 front end.

Example

localhost/magento/?___store=french&___from_store=german

To

localhost/magento/(some german string) like

localhost/magento/de_DE/

If Spanish

localhost/magento/(some spanish string)

I have tried this but no luck.

Any help much appreciated?


texts: Payment method doesn't show up in checkout page frontend

texts:
I've been trying to implement a payment method into our store, however, when i check the checkout process, it says it can't be completed since there are no payment methods enabled, i'm using Magento 1.9.2 and i'm using the hellowired theme, i've enabled multiple payment methods, however none of them are working.

The website URL is: ittd.nl/magento

A very annoying problem,  could anyone here help me out, so customers can buy online at our store?

Many Thanks!

Clay


texts: API Coupon Code Generation Invalid Value Type Response

texts:
Attempting to dynamically generate a coupon code for a Sales Rule that I created withing the admin UI, using a REST API call.
I am sending the bare minimum required (according to the documentation) in JSON format:
{
    "couponSpec": {
        "rule_id": 921,
        "format": "AlphaNum",
        "quantity": 1,
        "length": 12
    } }

When making the POST call using /rest/defaults/V1/coupons/generate I receive the following response:

I am using Postman to create the calls.  Using Magento 2.3.5.
Any suggestions on how to correct this issue?


texts: Magento 2 Restore backup error: Invalid "rollback file"

texts:
I have created backups through the web interface.

Now I am running the rollback command from command line, but I am getting an error like invalid rollback file.

What could be the reason for this and how I can fix this?

The command I have tried to execute is below:

php bin/magento setup:rollback -d 1530455588_db_after_site_responsive_1_july_18.sql

php bin/magento setup:rollback -c 1530454706_nomedia_backup_after_site_responsive_01_July_18.tgz -d 1530455588_db_after_site_responsive_1_july_18.sql

On running both commands I am getting the same error.


texts: Magento2 - Sale order grid column "Grand Total (Base)","Grand Total (Purchased)" display default website currency not store or website currency

texts: I have a multi website store. Each website i have added a base currency and set display currency(both are same). But in the backend sales order grid view for all the orders "Grand total(base)" and "Grand total(purchased)" price currency showing the default website currency not the currency of the website where the order is placed. I have added currency rates for all the currencies in the backend, but no change.


texts: check 'add store code to urls' enabled/not by admin

texts:
I need to get the exact URL when customer visit my site on first time,
It is based on following options

base url that depends on default website,store and store view,
store code to urls enabled or not.

I got the base URL by

$websites = Mage::getModel('core/website')->getCollection()->addFieldToFilter('is_default', 1);
$website = $websites->getFirstItem();
$websiteId = $website->getId();
$websiteCode = $website->getCode();
$baseUrl = Mage::getConfig()->getNode('web/unsecure/base_url', 'website', $websiteCode);

The URL will be appended with store code if  store code to urls is enabled in admin.

how to check store code to urls enabled programmatically in magento?


texts: How to disable sending of Newsletter email in Magento2

texts:
I ran across an old thread on how to disable sending of newsletter emails, but it was for Magento 1.9.

How can we disable sending of newsletter emails in Magento2?


texts: Get Bundle Product to display its "base" simple product with Special and Regular Prices

texts:
My site sells Bundled Products (Laptops/Desktops). The product is set up as follows: The bundle product's price is dynamic. A simple required product (the laptop itself) that has a price and inventory - this forms the base or minimum price of the bundle. Then the options are set up as optional simple products (they also have a price and inventory and must be set up in this way as we have limited inventory and different prices for bulk users). See link below:
http://www.refreshedbyus.com/lenovo-t420-laptop-b
This works well except for one big issue - I need to be able to put the base simple product of the bundle on sale and have the old/new prices be visible. I can put the simple product on sale and it will display the correct price, but not the strike-through old price.

I need to keep the set up as is for the reasons above - i.e. each of the products and options have set prices for groups and inventory. I can't apply the bundle percentage discount as it will discount the whole lot - I only want to discount the simple product.

Any ideas?! Please let me know. Have tried countless solutions and have looked through this forum and others and the answer to this question I cannot find.


texts: Magento 2.2.3: Enable agreements always disabled

texts:
Dashboard >> Stores >> Configurations >> Sales >> Checkout Options >> Enable Terms and Condition always set NO after saved value as YES many times.

Magento Version: 2.2.3
Control Panel: Plesk Onyx
Server: Nginx


texts: I want to display guest customer telephone number on success page.how can i do this?


texts: How to create a pdf download file in Magento 1 my account custom module?

texts:
I have a custom module that allows customer to returns the product.
Everything working fine and i want to generate a label pdf to paste in the return box.I tried below approach and i am getting error. I used dompdf.

require_once 'dompdf/autoload.inc.php';
use Dompdf\Dompdf;
$pdfName = "unique_file_name";
$html = "My Printing Label Goes Here";

// instantiate and use the dompdf class
$dompdf = new Dompdf();
$dompdf->loadHtml($html);

// (Optional) Setup the paper size and orientation
$dompdf->setPaper('A4', 'portrait');

// Render the HTML as PDF
$dompdf->render();

// Output the generated PDF to Browser
$dompdf->stream($pdfName);

Uploaded the dompdf library to my lib folder.

I am getting an error in system.log. The error is as follow:

ERR (3): Warning: include(Dompdf\Dompdf.php): failed to open stream: No such file or directory  in C:\xampp\htdocs\my_project\lib\Varien\Autoload.php on line 94

But if I use the same folder out of the magento its working fine.

Can any one help me in this to short out please.

UPDATE

I copied the dompdf folder in to lib folder


texts:
I Have a form also it redirect to same page. I try to display Success message After Product add to the cart but it showing whenever i reload the page

  <form action="<?php echo Mage::helper('checkout/cart')->getAddUrl(Mage::registry('current_product')); ?>" method="post" id="seller_addtocart_form1" class="ma">
                                <input type="hidden" name="return_url" value="<?php echo $currentUrl =  Mage::helper('core/url')->getCurrentUrl();?>" />
                                <input type="hidden" value="<?php echo $seller->getMpassignproductId(); ?>" name="mpassignproduct_id" class="mpassignproduct_id"/>
    <?php echo Mage::getSingleton('core/session')->addSuccess('Success');?>

    <button id="<?php echo $seller->getMpassignproductId() ?>" class="button btn-cart customaddtocart" title="<?php echo $this->__('Add to Cart')?>" onclick="<?php echo $currentUrl = Mage::helper('core/url')->getCurrentUrl();?>">
<?php echo $this->__('Add to Bag')?></button>
<button class="button buy-now" onclick="location.href ='{{config path="web/secure/base_url"}}/checkout/cart/add?product=1&qty=1'">
Buy Now</button>

</form>

What mistake i have done


texts: Magento 2: PHP Parse error when moved to production

texts:
PHP Parse error: syntax error, unexpected '<' Magento 2 Production mode

[UPDATE]

The reason I had this issue is that I had enabled the Minify Html from Template Settings in Developer Configuration.


texts: Tax on Shipping only when Cart have taxable item

texts:
I want to configure the tax on shipping only when the cart has any taxable product.

How can I do this?


texts: Getting Magento 2 CMS page programatically fails to render widget?

texts:
I'm attempting to get data from the CMS pages programatically via the REST api, it seems that widgets aren't rendered correctly.

<?php
namespace XXXX\Restapi\Model;

class Cms implements \XXXXX\Restapi\Api\CmsInterface
{
    private $pageRepo;
    private $filterProvider;
    private $storeManager;
    private $pageFactory;

    /**
     * {@inheritdoc}
     */
    public function __construct(\Magento\Cms\Model\Template\FilterProvider $filterProvider,
                                \Magento\Cms\Model\PageRepository $pageRepo,
                                \Magento\Store\Model\StoreManagerInterface $storeManager,
                                \Magento\Cms\Model\PageFactory $pageFactory)
    {
        $this->pageRepo = $pageRepo;
        $this->filterProvider = $filterProvider;
        $this->storeManager = $storeManager;
        $this->pageFactory = $pageFactory;
    }

    /**
     * {@inheritdoc}
     */
    public function page($id) {
        $storeId = $this->storeManager->getStore()->getId();
        $page = $this->pageFactory->create();

        $page->setStoreId($storeId);
        $page->load($id, 'identifier');
        $pageFilter =  $this->filterProvider->getPageFilter();
        $p[] = [
            'title' => $page->getTitle(),
            'content' => $pageFilter->filter($page->getContent()),
        ];

        return $p;
    }
}

All I get from this is HTML with all the links on the page rendered correctly with base URLs, it's just widgets that fail to render any html.


texts:
I am trying to observe the data being passed when an admin creates a new order in the backend. I do not want to observe front end orders that are being created.

I currently have the following:

etc/config.xml

....
     <events>
         <sales_order_save_after>
            <observers>
                <modulename_order_new>
                    <class>module_name/observer</class>
                    <method>handleCustomerFirstOrder</method>
                </modulename_order_new>
            </observers>
        </sales_order_save_after>
     </events>
....

Module_Name_Model_Observer

public function handleCustomerFirstOrder($observer)
{
    $order = $observer->getEvent()->getOrder();
    Mage::Log('Order Info: ' . $order);
}

So far I am unable to even print the log to see what it contains. I get the following:

*Recoverable Error: Object of class Mage_Sales_Model_Order could not be converted to string*

I have even tried:

Mage::Log('Order Info: ' . print_r($order));

But that does not work either.

I am needing to observe when the admin creates a new order and capture the data. Specifically the customer ID, Order #, and item product Id #'s.

Any help would be greatly appreciated.

Thanks


texts: How to redirect to cms page after login using an ajax login / register module?

texts:
I am using Magento 1.9 on localhost with wamp. I am using an ajax login and register module which redirects to customer account. The login and register are on the homepage. I am trying to redirect to a custom cms page after login, or after registering. I've contacted the developper but so far no replies, so I thought I would try here.

The template file which is used for the homepage, for login forms and register forms looks like this:

<?php // If user is not logged in ?>
<?php if (Mage::helper('customer')->isLoggedIn() != true) : ?>

<?php /* else if the user is logged in */
else :

// redirect to http://127.0.0.1/website/landing-page/

endif; ?>

so far I've tried:

<?php /* else if the user is logged in */
else :
$url="http://127.0.0.1/website/landing-page";
$this->_redirectUrl($url);
endif; ?>

That gave me the following error in  Magento:

Invalid method Youama_Ajaxlogin_Block_Ajaxlogin::_redirectUrl(Array
(
    [0] => http://127.0.0.1/website/landing-page
)
)

note: $this->_redirectUrl($url); and $this->_redirect($url); gave the same error message.

I tried another way:

$url="http://127.0.0.1/website/landing-page";
Mage::app()->getFrontController()->getResponse()->setRedirect($url)->sendResponse();

That gave an error in Firefox saying that there is a redirect loop problem. Another try was:

$url="http://127.0.0.1/website/landing-page";
Mage::app()->getResponse()->setRedirect($url);

That also  gave an error in Firefox saying that there is a redirect loop problem

I've read that there are ways to redirect to external links wich should specifically be used for that, and then other methods of redirecting. I believe I should edit the module controller to make the redirection work.

The ajax login module controller ( AccountController.php ) looks like this :

class Youama_Ajaxlogin_AccountController extends Mage_Customer_AccountController

{
    /**
     * @var string
     */
    protected $_url;

    /**
     * Before actions.
     * @return Mage_Core_Controller_Front_Action|void
     */
    public function preDispatch()
    {
        $this->_url = Mage::getBaseUrl() . '?yregister';

        parent::preDispatch();
    }

    /**
     * Disable login action.
     */
    public function loginAction()
    {
        $this->_setLocation();
    }

    /**
     * Disable create action.
     */
    public function createAction()
    {
        $this->_setLocation();
    }

    /**
     * Redirect to home.
     */
    protected function _setLocation()
    {
        Mage::app()->getFrontController()->getResponse()->setRedirect($this->_url);
    }
}

I believe I have to add or change some lines of code there in order to be able to use $this->_redirectUrl($url); or $this->_redirect($url);

Any help would really be appreciated at this point, I'd love to understand how this works.


texts: Get custom category attribute value in Magento 2

texts:
How will I get the custom created category attribute value on the product list page?

I have seen many answers but no one is working.


texts:
i worte code to modify product name and url .

i am able to change name but url does not works below is mycode :

    public function modifyallname(Varien_Event_Observer $observer) {
        $products = $observer->getCollection();
        foreach( $products as $product )
        {
            $product->setUrlKey('111');
            $product->setName($product->getName().' & '.$pricetoadd->getName().' '.$customprice);
        }
   }


texts: How To add renderer to magento admin form field in magento 2

texts:
I have one field in my custom admin form.I want to add a color picker to the field.
Below is my code lines in main.php file.

$fieldset->addField(
        'state',
        'select',
        [
            'label' => __('State'),
            'title' => __('State'),
            'name' => 'state',
            'options' => \Ayakil\OrganizationClub\Block\Adminhtml\Organizationclub\Grid::getOptionArray6(),
            //'options' => $optionsc,
            'disabled' => $isElementDisabled
        ]
    );

$field = $fieldset->addField(
        'club_color',
        'text',
        [
            'name' => 'club_color',
            'label' => __('Color'),
            'title' => __('Color')
        ]
    );
    $renderer = $this->getLayout()->createBlock('Ayakil\OrganizationClub\Block\Adminhtml\Color');
    $field->setRenderer($renderer);

color.php file

<?php
namespace Ayakil\OrganizationClub\Block\Adminhtml;
class Color extends \Magento\Config\Block\System\Config\Form\Field {
public function __construct(
    \Magento\Backend\Block\Template\Context $context, array $data = []
) {
    parent::__construct($context, $data);
}

protected function _getElementHtml(\Magento\Framework\Data\Form\Element\AbstractElement $element) {
    $html = $element->getElementHtml();
    $value = $element->getData('value');

    $html .= '<script type="text/javascript">
        require(["jquery","jquery/colorpicker/js/colorpicker"], function ($) {
            $(document).ready(function () {
                var $el = $("#' . $element->getHtmlId() . '");
                $el.css("backgroundColor", "'. $value .'");

                // Attach the color picker
                $el.ColorPicker({
                    color: "'. $value .'",
                    onChange: function (hsb, hex, rgb) {
                        $el.css("backgroundColor", "#" + hex).val("#" + hex);
                    }
                });
            });
        });
        </script>';
    return $html;
}
}

My form is looking like below.

How can i align the color field like state without using css.is there any ways to achieve it?


texts: Issue Management Protocols for Merchant Teams

texts:
Wondering if there are any good, established protocols that Magento merchants (or solutions providers) use to prioritize and triage incoming issues filed by the customer support team, marketing, sales, etc.

For example, levels of urgency / importance, such as:

Blocking customers from placing orders
Blocking customer support from placing orders in the backend
Feature with the potential to earn $X of additional revenue
Feature with the potential to increase customer satisfaction
...


texts: Magento 1.7. error after attempting restore to backup

texts:
A frustrating mishap.
Did a backup in anticipation of testing a module install. Didn't like the module install so restored to backup.

After restore cannot login to admin. Front and back both have error as follows below. Reviewed the files by FTP. No Lib folder, no JS folder, no Media folder. Other folders are there and the contents appear to be there, but since there are hundreds of files, I've no way to know. Can I just re-install the missing folders?

  Warning: include_once(Varien/Autoload.php): failed to open stream: No
  such file or directory in
  /homepages/9/d464072087/htdocs/shop/app/Mage.php on line 50

  Warning: include_once(): Failed opening 'Varien/Autoload.php' for
  inclusion
  (include_path='/homepages/9/d464072087/htdocs/shop/app/code/local:/homepages/9/d464072087/htdocs/shop/app/code/community:/homepages/9/d464072087/htdocs/shop/app/code/core:/homepages/9/d464072087/htdocs/shop/lib:.:/usr/lib/php6')
  in /homepages/9/d464072087/htdocs/shop/app/Mage.php on line 50

  Warning: include(Varien/Autoload.php): failed to open stream: No such
  file or directory in
  /homepages/9/d464072087/htdocs/shop/app/code/core/Mage/Core/functions.php
  on line 68

  Warning: include(): Failed opening 'Varien/Autoload.php' for inclusion
  (include_path='/homepages/9/d464072087/htdocs/shop/app/code/local:/homepages/9/d464072087/htdocs/shop/app/code/community:/homepages/9/d464072087/htdocs/shop/app/code/core:/homepages/9/d464072087/htdocs/shop/lib:.:/usr/lib/php6')
  in
  /homepages/9/d464072087/htdocs/shop/app/code/core/Mage/Core/functions.php
  on line 68

Fatal error: Class 'Varien_Autoload' not found in
/homepages/9/d464072087/htdocs/shop/app/Mage.php on line 53

Thanks to all in advance,
dbc


texts: Is it possible to create uiComponent block programatically?

texts:
It is required to add custom grid in a new tab in System -> User roles -> Role.

I was thinking of uiComponent grid however, when I digged into sources I found that users grid is composed via deprecated \Magento\Backend\Block\Widget\Grid\Extended class which is set as children to parent tab block programatically:

/**
 * @return $this
 */
protected function _prepareLayout()
{
    $this->setChild(
        'userGrid',
        $this->getLayout()->createBlock(\Magento\User\Block\Role\Grid\User::class, 'roleUsersGrid')
    );
    return parent::_prepareLayout();
}

It there a way of programmatically create uiComponent block ?


texts: How to add custom product on catalog search collection?

texts:
Currently I am trying to add some custom products on CatalogSearch collection . For this I am working on Mage_CatalogSearch_Model_Layer. I know that its core part of Magento but whenever I 'll get any success on this code I will override CatalogSearch_Model.

Rightnow I am working on this method

 public function prepareProductCollection($collection)
    {
        $collection
            ->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())
            ->addSearchFilter(Mage::helper('catalogsearch')->getQuery()->getQueryText())
            ->setStore(Mage::app()->getStore())
            ->addMinimalPrice()
            ->addFinalPrice()
            ->addTaxPercents()
            ->addStoreFilter()
            ->addUrlRewrite();

        Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);
        Mage::getSingleton('catalog/product_visibility')->addVisibleInSearchFilterToCollection($collection);

// my custom code start

$collection2 = Mage::getModel('catalog/product')->getCollection()->addFieldToFilter('entity_id', array(1,2));

$collectiondata=$collection2->getData();

foreach($collectiondata as $customdata)
{
$collection->addItem($customdata);
}

        return $this;
    }

With this code I can able add my custom product into the original collection but It create an Issue on catalog search result. It Means If in search result original product found then it successful works otherwise not.

Any help will be appreciated

Thank you


texts:
I am new to magento,I have created a custom module for magento backend. I don't know how to get its url, I have tried some help from online, nothing happens, please tell what should I pass into getUrl function.How should I use
$url = Mage::helper("adminhtml")->getUrl('/your_module/index');
my file

confic.xml

<modules>
    <Petra_DailyOrders>
        <version>1.0.0</version>
    </Petra_DailyOrders>
</modules>

<global>
    <helpers>
        <petra_dailyorders>
            <!-- Helper definition needed by Magento -->
            <class>Mage_Core_Helper</class>
        </petra_dailyorders>
    </helpers>
</global>

<admin>
    <routers>
        <adminhtml>
            <args>
                <modules>
                    <petra_dailyorders before="Mage_Adminhtml">Petra_DailyOrders_Adminhtml</petra_dailyorders>
                </modules>
            </args>
        </adminhtml>
    </routers>
</admin>

<adminhtml>
    <layout>
        <updates>
            <petra>
                <file>dailyorders.xml</file>
            </petra>
        </updates>
    </layout>
</adminhtml>


texts: Magento 1.9.2.3 Customer Password Reset return "Your password reset link has expired"

texts: Forgot Your Password Not working at the customer end, how to solve this error? If click Reset Password from Email returns Your password reset link has expired.


texts: Why can't magento accept `content` as a database field name?

texts:
I am creating a new module and in that module I add a form which has a field name content in the database.

Now when I add a wyswig editor in this form with the field name content in the database, the layout of the form in the backend changes completely as compared to default layout.

But when I changed the database field name from content to any other name lets say content_html or content_h etc etc., the layout of the form now appeared as a default form.

This happens only when I use wyswig editor, and without wyswig if I create simple form it accepts the values in the database under the content field name.

Why can't magento accept the content as a field name, using wyswig editor.


texts:
this is my code

<form id="search_mini_form" action="<?echo $this->getUrl('catalogsearch/advanced/result') ?>" method="get">

            <select name="category" id="category_search_field">

    <option  >All Categories</option>
    <?php echo $categoryOptions ?>
</select>
    <?php echo $this->__('Search:') ?>
        <input id="search" type="text" name="name" value="<?php echo $this->helper('catalogsearch')->getEscapedQueryText() ?>" class="input-text" />
       <input id="description" class="input-text" value = "<?php $_GET['name'] ?>" type="hidden"   title="Description"   name="description"/>
       <input type="hidden"   class="input-text " value = "<?php $_GET['name'] ?>" title="Short Description"   id="short_description" name="short_description"/>
       <input type="hidden"   class="input-text " value = "<?php $_GET['name'] ?>" title="Artist First Name"   id="artist_first_name" name="artist_first_name"/>
        <input type="hidden"   class="input-text "  value = "<?php $_GET['name'] ?>" title="Artist Last Name"   id="artist_last_name" name="artist_last_name"/>
        <button type="submit" title="<?php echo $this->__('Search') ?>" class="button"><?php echo $this->__('Search') ?></button>

what I tried is to get the value of name field into rest of the hidden fields while submitting the form but when I submit the form the form gets re-directed and the values are passed as value ""
all I need to do is

give the option to search in a particular category with the particular attribute
what value should I assign that when the user selects default option it searched in all category or attributes
how do I make this search works so that input from search box search in all desired attribute, not just the name


texts: Cron.php not working using cronjob setting from Cpanel and no confirmation mail send to customer in magento 1.9.2.4

texts:
I just set cron job using cpanel of my site,

according to that cron.php runs in every 5 mins.

But it's not.
It is working whenever  I execute cron.php directly from browser.

Here is the code of my cron.php :

chdir(dirname(__FILE__));
require 'app/bootstrap.php';
require 'app/Mage.php';
if (!Mage::isInstalled()) {
    echo "Application is not installed yet, please complete install wizard first.";
   exit;
}
// Only for urls
// Don't remove this
$_SERVER['SCRIPT_NAME'] = str_replace(basename(__FILE__), 'index.php', $_SERVER['SCRIPT_NAME']);
$_SERVER['SCRIPT_FILENAME'] = str_replace(basename(__FILE__), 'index.php', $_SERVER['SCRIPT_FILENAME']);
Mage::app('admin')->setUseSessionInUrl(false);
umask(0);
$disabledFuncs = explode(',', ini_get('disable_functions'));
$isShellDisabled = is_array($disabledFuncs) ? in_array('shell_exec', $disabledFuncs) : true;
$isShellDisabled = (stripos(PHP_OS, 'win') === false) ? $isShellDisabled : true;
$isShellDisabled = true;
try {
    if (stripos(PHP_OS, 'win') === false) {
        $options = getopt('m::');
        if (isset($options['m'])) {
            if ($options['m'] == 'always') {
                 $cronMode = 'always';
            } elseif ($options['m'] == 'default') {
                 $cronMode = 'default';
            } else {
                 Mage::throwException('Unrecognized cron mode was defined');
             }
        } else if (!$isShellDisabled) {
            $fileName = escapeshellarg(basename(__FILE__));
            $cronPath = escapeshellarg(dirname(__FILE__) . '/cron.sh');

            shell_exec(escapeshellcmd("/bin/sh $cronPath $fileName -mdefault 1 > /dev/null 2>&1 &"));
            shell_exec(escapeshellcmd("/bin/sh $cronPath $fileName -malways 1 > /dev/null 2>&1 &"));
            exit;
        }
    }
    Mage::getConfig()->init()->loadEventObservers('crontab');
    Mage::app()->addEventArea('crontab');
    if ($isShellDisabled) {
        Mage::dispatchEvent('always');
        Mage::dispatchEvent('default');
    } else {
        Mage::dispatchEvent($cronMode);
    }
} catch (Exception $e) {
    Mage:: printException($e); //Please remove space after Mage:: p
    exit(1);
}

please check and let me know why its not working or call automatically, no mail send to customers when they purchase any product.


texts:
I've combined my checkout page (OneStepCheckout) and cart page. The /checkout/cart (the cart page) is still accessible, and I wouldn't want my customer to accidentally access that page (reviewing your cart twice would be quite confusing).

Is there anyway I can redirect this page with magento to /checkout ?


texts: Invalid crendetials when runing composer require magento 2 extension

texts: I got this error when running this command composer require my extension from marketplace :


texts:
I'm trying to disable the Qty field on the product edit tab.

I've created a local Mage override of:

app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Simple.php on line 140 (original):

/* Inventory Data */
    $fieldset->addField('simple_product_inventory_qty', 'text', array(
        'label' => Mage::helper('catalog')->__('Qty'),
        'name'  => 'stock_data[qty]',
        'class' => 'validate-number',
        'required' => true,
        'value'  => 0
    ));

And changed it to:

/* Inventory Data */
    $fieldset->addField('simple_product_inventory_qty', 'text', array(
        'label' => Mage::helper('catalog')->__('Qty'),
        'name'  => 'stock_data[qty]',
        'disabled' => true,
        'value'  => 0
    ));

I've flushed the cache & still no difference. I've even tried editing the core file itself for testing purposes, and even that makes no difference, even if I completely remove the whole field set addition.


texts:
Error found: Apparently the problem was that another class 'Edit' which extends 'Slide' was mispelled in the class-declaration. Instead of reporting a missing class 'Edit' it gave me that weird error.

I am trying to create an edit page in the Backend for my Entity. I have succeeded in setting up the Grid with help of several tutorials, but when I try to call upon the edit page I get just a blank page and following error in my php error.log:

[Wed May 24 12:11:10.565841 2017] [:error] [pid 29789] [client 192.168.144.27:58131] PHP Fatal error:
Uncaught TypeError:
Argument 1 passed to Myvendor\\Slideshow\\Controller\\Adminhtml\\Slide::__construct() must be an instance of
    Magento\\Backend\\App\\Action\\Context, instance of Magento\\Framework\\ObjectManager\\ObjectManager given,
called in /var/www/html/magento2/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 93 and
defined in /var/www/html/magento2/app/code/Myvendor/Slideshow/Controller/Adminhtml/Slide.php:39

nStack trace:
#0 /var/www/html/magento2/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(93):
    Myvendor\\Slideshow\\Controller\\Adminhtml\\Slide->__construct(Object(Magento\\Framework\\ObjectManager\\ObjectManager))
#1 /var/www/html/magento2/vendor/magento/framework/ObjectManager/Factory/Compiled.php(88):
    Magento\\Framework\\ObjectManager\\Factory\\AbstractFactory->createObject('Myvendor\\\\Slidesho...', Array)
#2 /var/www/html/magento2/vendor/magento/framework/ObjectManager/ObjectManager.php(57):
    Magento\\Framework\\ObjectManager\\Factory\\Compiled->create('Myvendor\\\\Slidesho...', Array)
 #3 in /var/www/html/magento2/app/code/Myvendor/Slideshow/Controller/Adminhtml/Slide.php on line 39,

Myvendor\Slideshow\Controller\Adminhtml\Slide.php:

namespace Myvendor\Slideshow\Controller\Adminhtml;

use Magento\Backend\App\Action;
use Magento\Framework\Registry;
use Magento\Framework\View\Result\PageFactory;
use Myvendor\Slideshow\Model\SlideFactory;

abstract class Slide extends Action
{
/**
 * Core registry
 *
 * @var \Magento\Framework\Registry
 */
protected $_coreRegistry;

/**
 * Result page factory
 *
 * @var \Magento\Framework\View\Result\PageFactory
 */
protected $_resultPageFactory;

/**
 * Slide model factory
 *
 * @var \Myvendor\Slideshow\Model\SlideFactory
 */
protected $_slideFactory;

/**
 * @param \Magento\Backend\App\Action\Context $context
 * @param Registry $coreRegistry
 * @param PageFactory $resultPageFactory
 * @param SlideFactory $slideFactory
 */
public function __construct(
\Magento\Backend\App\Action\Context $context,
Registry $coreRegistry,
PageFactory $resultPageFactory,
SlideFactory $slideFactory
)
{
    parent::__construct($context);
    $this->_coreRegistry = $coreRegistry;
    $this->_resultPageFactory = $resultPageFactory;
    $this->_slideFactory = $slideFactory;
}

/**
 * Slide access rights checking
 *
 * @return bool
 */
protected function _isAllowed()
{
    return $this->_authorization->isAllowed('Myvendor_Slideshow::manage_slide');
}
}

I am not sure what other classes or xml I need to look at to figure out where this error is coming from. This leaves me rather perplexed right now. I checked the namespaces, they seem all correct. How do I go best about debugging this?

I've cleared var/generation to no effect.


texts: difference in result of count and getSize()

texts:
I am preparing the product collection as follows

$visibleProducts = $this->catalogProductVisibility->getVisibleInCatalogIds();
$collection = $this->productCollectionFactory->create();
$collection->addAttributeToFilter(
    'status',
    ['in' => $this->productStatus->getVisibleStatusIds()]
);
$collection->setVisibility($visibleProducts);
$collection->addAttributeToFilter('sku', ['in' => $skus]);
$collection->addStoreFilter();

$collection->addAttributeToSelect(['new', 'name'])
            ->addAttributeToFilter('new', 1)
            ->setPageSize($limit);

$collection->getSize() and count($collection->getItems()) is showing different numbers.

Why is this so?


texts: Magento call jquery-ui progressbar after prototype ajax request successfull

texts:
I have done ajax add to cart product from product page, I am able to update the top cart contents successfully on Prototype ajax request success, but when I try to initialize the jquery progressbar(which is already included in top cart) from the success event of the prototype ajax request, then it doesn't work at all.

Progress bar works fine if I do a page reload (document ready).

Below is my code.

function updatetopcart() {
    var ajxformurl = $('ajaxTLUrl').getValue();
    new Ajax.Request(ajxformurl, {
    onSuccess: function(response) {
        var transport = response.responseText.evalJSON(true);
        var toplinkcontent = transport.content;
        //alert(toplinkcontent);
        $$('#minicart').invoke('replace', toplinkcontent);
        //Reset top cart hover flap
        resetFlaps();
        //Reset free delivery progress bar
        resetFDBar();
        return true;
    },
    onException: function(request,e){
        //console.log(e.message);
        alert(e.message);
    }
    });
}
function resetFlaps() {
    $('minicart').observe('mouseover', function(e) {
        $('minicart-panel').setStyle({backgroundColor: '#FFFFFF'});
        $('minicart-panel').show();
    });
    $('minicart').observe('mouseout', function(e) {
        $('minicart-panel').hide();
    });

    $('minicart_mobile').observe('mouseover', function(e) {
        $('minicart-panel_mobile').setStyle({backgroundColor: '#FFFFFF'});
        $('minicart-panel_mobile').show();
    });
    $('minicart_mobile').observe('mouseout', function(e) {
        $('minicart-panel_mobile').hide();
    });
    return true;
}

function resetFDBar() {
    (function($) {
        jQuery("#free_delivery").progressbar({
            max: Number(jQuery('#maxPriceVal').val()),
            value: Number(jQuery('#currPriceVal').val())
        });
    })(jQuery);
    return true;
}


texts:
I need help in 2 questions:

  1 - Put a delay for the newsletter popup to open after the uploaded
  website + 10s

  2 - I have 2 javascript (tidio and whatshelp.io) in
  the footer, the problem occurs when I insert an item in the cart, my
  template goes up a bar with the item and the chat icon is on top, I
  wanted to reposition it

1- The newsletter block has the content

And here the content of the popup_subscribe.phtml

// @codingStandardsIgnoreFile
?>

<?php /* @escapeNotVerified */ echo __('Newsletter') ?>

        <form class="form subscribe"
            novalidate
            action="<?php /* @escapeNotVerified */ echo $block->getFormActionUrl() ?>"
            method="post"
            data-mage-init='{"validation": {"errorClass": "mage-error"}}'
            id="popup-newsletter-validate-detail">

                <?php /* @escapeNotVerified */ echo __('Sign Up for Our Newsletter:') ?>

                    <input name="email" type="email" id="popup-newsletter"
                                placeholder="<?php /* @escapeNotVerified */ echo __('Enter your email address') ?>"
                                data-validate="{required:true, 'validate-email':true}"/>

                <button class="action subscribe primary" title="<?php /* @escapeNotVerified */ echo __('Subscribe') ?>" type="submit">
                    <?php /* @escapeNotVerified */ echo __('Subscribe') ?>
                </button>

        </form>

2- Example of code inserted in the footer

Whatshelp icon overlay image over bar checkout button.


texts: Is there any documentation tool available for GraphQl?

texts:
I need to document both Magento2 in-built and custom GraphQl endpoints. (Just like we use swagger to document APIs). So far I tried the below tools. But both seem to be covering a limited number of GraphQl endpoints. They do not generate documentation for all the GraphQl endpoints available in Magento.

https://github.com/APIs-guru/graphql-voyager
https://github.com/2fd/graphdoc#readme

It would be great if you can share any tool which you have used to document GraphQl


texts: How to remove "carrier title","method title" from checkout in Magento 2?

texts:
I am using 2.3.1 and the pearl theme. Currently my shipping looks like this:

However, since we don't let our customers pick the carrier it seems confusing and I would like it to look like this:

I've been digging around and have looked at

/vendor/magento/module-checkout/view/frontend/web/template/shipping.html
 <your_module_dir>/view/frontend/layout/checkout_index_index.xml

but neither of these seem to have what I'm looking for. How can I remove these labels?

EDIT per comments:
If shipping.html is the right place what code should I edit to remove the labels?


texts:
After updated Magento to v2.3.4

getimagesize('/var/www/project...') called at
[vendor/magento/module-media-gallery-synchronization/Model/CreateAssetFromFile.php:78]

Magento\MediaGallerySynchronization\Model\CreateAssetFromFile->execute(&SplFileInfo#000000002a784b8c00000000625dafb8#) called at [vendor/magento/module-media-gallery-integration/Plugin/SaveBaseCategoryImageInformation.php:94]

When i use $this->imageUploader->moveFileFromTmp($image, true) [vendor/magento/module-catalog/Model/ImageUploader.php] method;
How i can fix it is?


texts: Url key disappearing and visibility changing when saving a product from collection

texts:
I'm encountering the problem of the url key being unset and the visibility not retaining its original value when I'm retrieving a product collection, iterating through it to set a value per product, and then saving it as in the following:

$products = Mage::getModel('catalog/product')
    ->getCollection()
    ->addAttributeToFilter('type_id', 'configurable');

foreach ($products as $product) {
    $product->setDescription('custom description');
    $product->save();
}

However, if I add those attributes to be selected

$products = Mage::getModel('catalog/product')
    ->getCollection()
    ->addAttributeToSelect('url_key')
    ->addAttributeToSelect('visibility')
    ->addAttributeToFilter('type_id', 'configurable');

Then I'm able to save the product fine, and the url key and visibility retain their values.

A. Is this the correct way to handle this, or is there something else that I am supposed to set before I retrieve the collection?

B. Are there any other product attributes that have this same issue? (I didn't notice any other ones)

Thanks.


texts: How can I integrate Magento website with wordpress website and create a SSO(single sign on) between both websites?

texts:
I am trying to integrate a new website(Wordpress website) with a Magento website, I've made the API integration using php curl, I've also add the Magento website url to the new website.
I can create account and authenticate the users through the Magento API but this is limited to the API features only, the problem now is I don't know how can I let the user login through the new website(the Wordpress website) and when he/she visits the Magento website he doesn't have to login again. (A single sign on) between the two websites.
I've tried the following but can't figure out how to pass the users data to the browser so he doesn't have to login again in the Magento website.
Any other suggestions are welcomed too.

   $curl = curl_init();

  curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://<my_domain>/rest/V1/integration/customer/token',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => '',
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS => array('username' => '<my_username>','password' => '<my_password>'),
    CURLOPT_SSL_VERIFYPEER => FALSE,
    CURLOPT_SSL_VERIFYHOST => 2,
  ));

  $token = curl_exec($curl);

  echo ($token) . "<hr>";

  $curl = curl_init();

  curl_setopt_array($curl, array(
    CURLOPT_URL => '<my_domain>/rest/V1/customers/me',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => '',
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => array(
      'Authorization: Bearer ' . json_decode($token),
    ),
    CURLOPT_SSL_VERIFYPEER => FALSE,
    CURLOPT_SSL_VERIFYHOST => 2,
  ));

  $response2 = curl_exec($curl);

  echo $response2;


texts: Trying to update Manufacturer value but not working Magento

texts:
I am trying to set or update Manufacturer value using code but its not working.Manufacturer is dropdrown on admin side.I am trying code like this :

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

        $loadpro= $productcity->load($id);
       $loadpro->setManufacturer($wholedata['manufacture']);
        $loadpro->save();

What am i doing wrong ? thanks
I am adding screenshot for attribute.May be it help


texts:
By default, magento provides two options CSV and XML file format for the export.

So how can I keep one of them for export in ui component based listing ?


texts: how to send email based on user selected locale

texts:
Sending email based on locale that user selected.

$locale='en_US';
$emailTemplate  = Mage::getModel('core/email_template')
                                ->loadDefault('test_reminder_email');
$emailTemplate->setDesignConfig(array('area' => 'frontend', 'store' => $iDefaultStoreId));
$emailTemplate->setSenderName(Mage::getStoreConfig('trans_email/ident_general/name'));
$emailTemplate->setSenderEmail(Mage::getStoreConfig('trans_email/ident_general/email'));
$subject=$product->getName().$this->__(' test Ended');
$emailTemplate->setTemplateSubject($subject);
$emailTemplateVariables = array();
$processedTemplate = $emailTemplate->getProcessedTemplate($emailTemplateVariables);
$emailTemplate->send($customer->getEmail(),$customer->getName(), $emailTemplateVariables,$storeId=null);


texts:
I have this module adding "packing stations"
In "my account" i want to be able to change the users active station.
Therefore i need to push the "userid" into selected "code".

My array when unserialized looks like:

Array
(
    [_1478435099391_391] => Array
        (
            [user] => 9
            [code] => #PACKINGSTATION 1
        )

    [_1478608807336_336] => Array
        (
            [user] => 100
            [code] => #PACKINGSTATION 2
        )

)

How can i push a new user into packingstation 2 forexample?


texts: Magento 2 How to remove footer by website Id?

texts:
Hi I am having multi website, I want to remove entire footer from website id 3.
here is my xml file
Ubertheme/shop/Magento_Theme/layout/default.xml

here added the code.
  <referenceContainer name="footer-container" remove="true" />

This is removing footer from all websites. How to make it for only website Id 3.
Can I Get help?
Thank you in advance


texts: Modifying custom options of an item when adding it to the cart?

texts:
I am listening to the sales_quote_save_before event to notice when an item is added to the cart. Once its fired, I iterate through the items options like this:

$quote = $observer->getEvent()->getQuote();

foreach ($quote->getAllItems() as $item) {
    $options = $item->getProduct()->getTypeInstance(true)->getOrderOptions($item->getProduct());

    foreach($options['options'] as $option) {

         if($option['label'] == 'myOptionA') {
              // Here I want to change the selected value for the option
         }
     }
}

As you see, as soon as a certain option (myOptionA in the example) is reached, I want to change the selected option. So lets say myOptionA is a drop down and has 4 possible values. In case value 1 is selected, I want to set value 4 for that item. So when the cart is finished loading it should have value 4 for myOptionA. Not just its name, but its price as well. How could I do that?


texts: How to create an Adminhtml page with grid table getting data from custom MySQL table

texts:
I'm using Magento 1.9.0.1.

Right now i'm working on a custom extension for Magento and i need to know how to get the data from a custom MySQL table into a table in custom admin panel page.

I've already added a custom page in the admin panel, here it is:

Here is the code of this page /app/design/adminhtml/default/default/template/vivasindustries/smsnotification/about.phtml:

<h2> Hi there</h2>
This is new custom page where i must add a grid table!

In this page i want to add a grid table like this one:

This is just an example of what kind of table i need.
In this table there must be in first time so i can understand how the things work only 3 cells - Receiver,Phone and Date which is fetching data from my custom MySQL table VivasIndustries_SmsNotification.

Here is a picture from the phpMyAdmin so you can see the structure of the table VivasIndustries_SmsNotification:

So at final i want to say that i want this data to be snown in my custom admin page a grid table..

Please help me out to make this thing.

Thanks in advance!


texts: How to connect my custom js slick.min.js files with requirejs-config.js?

texts:
I need to make a slider for related-products. In order to override the template copied: app/design/frontend/{Vendor Theme}/{Theme name}/Magento_Catalog/templates/product/list/items.phtml.
there is a code inside items.phtml:
<script>
    (function  () {
        require(["jquery","jquery/jquery-migrate","slick"],function($) {
            jQuery(document).ready(function() {
                jQuery("#related").not('.slick-initialized').slick({
                    slide: 'li',
                    dots: true,
                    infinite: true,
                    speed: 2500,
                    slidesToShow: 4,
                    slidesToScroll: 4
                });
            });
        });
    })();
</script>

Now I wanted to pull the slick plugin code from the items.phtml file into a separate js file and include them via requirejs-config.js.
my requirejs-config.js file :
const config = {
    paths: {
        script: "Magento_Catalog/js/script/slider",
        'slick': "Magento_Catalog/js/slick/slick.min"
    },
    shim: {
        'slick': {
            deps: ['jquery', 'jquery/jquery-migrate']
        }
    }
};

The project structure:

My custom js file is script/slider.js with slick code.
How can I connect my custom slider.js and slick.min.js files with requirejs-config.js?
above I indicated how I am trying to connect them in equirejs-config.js , but this is unsuccessful.


texts: Magento 1.9: Custom category field for an image not showing on front end

texts:
I want to add a picture on top of category name in frontend. I tried creating a custom field for the category and adding a picture that way. I can see the custom field from admin, but I can't see anything I type in the custom textarea on my frontend category name. I tried flushing cache and reindexing data. I also tried adding in app/design/frontend/package/theme/template/catalog/category/view.phtml this code:

<?php if($_customAttribute = $this->getCurrentCategory()->getCustomAttribute()): ?>
    <?php echo $_helper->categoryAttribute($_category, $_customAttribute, 'custom_attribute') ?>
<?php endif; ?>

But when i added it all my products disappeared and I still coundn't see changes to my category name.

Atwix_CustomCategoryAttribute.xml

 <?xml version="1.0"?>
    <config>
        <modules>
            <Atwix_CustomCategoryAttribute>
                <active>true</active>
                <codePool>local</codePool>
            </Atwix_CustomCategoryAttribute>
        </modules>
    </config>

config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Atwix_CustomCategoryAttribute>
            <version>0.0.1</version>
        </Atwix_CustomCategoryAttribute>
    </modules>

    <global>
        <resources>
            <add_category_attribute>
                <setup>
                    <module>Atwix_CustomCategoryAttribute</module>
                    <class>Mage_Catalog_Model_Resource_Setup</class>
                </setup>
                <connection>
                    <use>core_setup</use>
                </connection>
            </add_category_attribute>
            <add_category_attribute_write>
                <connection>
                    <use>core_write</use>
                </connection>
            </add_category_attribute_write>
            <add_category_attribute_read>
                <connection>
                    <use>core_read</use>
                </connection>
            </add_category_attribute_read>
        </resources>
    </global>
</config>

mysql4-install-0.0.1.php

<?php
$this->startSetup();
$this->addAttribute(Mage_Catalog_Model_Category::ENTITY, 'custom_attribute', array(
    'group'         => 'General Information',
    'input'         => 'textarea',
    'type'          => 'text',
    'label'         => 'Custom attribute',
    'backend'       => '',
    'visible'       => true,
    'required'      => false,
    'visible_on_front' => true,
    'global'        => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
));

$this->endSetup();


texts: Making a frontend page for each entry in Model

texts:
I've been trying to find a example of this or a tutorial without having to resort to deconstructing a module off Magento connect, but I can't seem to find an example of doing this.

I've created a module that allows users in the back end to create lookbooks. They can tick them of as active/inactive, upload images, assign products to the image add a name and a archive image. This all works fine, and I'm able to access the model just fine in my templates header to output a list of all active lookbooks.

However I'm absolutely stuck when it comes to adding a custom route for say www.example.com/lookbook/{lookbook_id} or better yet www.example.com/lookbook/{lookbook_slug} so a user can view a specific lookbook. I've read several articles that talk about making a blog module, however they all seem to stop short of making the single pages for these modules, they seem to just have index pages.

I've been through the Magento extension developers guide and know it will involve adding a frontend routers in my config.xml but without an example, tutorial or better idea of what this is called in Magento terms I'm stuck.

Edit

I've managed to get the route working, and the view method is getting the correct data as i'm able to log it. However I'm not getting anything on page. With template hints on it's loading the 3 col template not the specified one col and the content is't being brought out.

This is my frontend/base/default/layout/lookbook.xml file

<?xml version="1.0"?>
 <layout version="0.1.0">

<lookbook_lookbook_view>
    <update handle="page_one_column" />
    <reference name="content">
        <block type="lookbook/lookbook_view" name="lookbook_view" template="lookbook/view.phtml" />
        </reference>
    </lookbook_lookbook_view>

</layout>

Exit 2

Idiot as I am, Completely forgot to add my layout file to my XML, so I've added the following to my config.xml

    <frontend>
        ...
        <layout>
            <updates>
                <Ahoy_Lookbook>
                    <file>lookbook.xml</file>
                 </Ahoy_Lookbook>
            </updates>
        </layout>
        ...
    </frontend>
</config>

So it's now loading the one page col correctly. Just doesn't seem to want to add my block to content.


texts: How to allow users to use specific controller actions (e.g. send form) in maintenance mode?

texts:
I created a custom maintenance page which appears after setting the maintenance.flag file.

The custom page has a few forms which I copied from the normal page, but they are not working.
Validation and date time picking works but If I send the form then I get 503 service unavailable in the network analysis.

I need the forms so that users can contact me and order stuff while the page is down.

It works without problems on the main page if the maintenance.flag is not set?

How can I allow the form on maintenance mode?

I tried to allow Mage by putting the following code at the top in errors/default/page.phtml:

error_reporting(E_ALL | E_STRICT);
$mageFilename = MAGENTO_ROOT . '/app/Mage.php';
require_once $mageFilename;
Mage::setIsDeveloperMode(true);
ini_set('display_errors', 1);
umask(0);
Mage::app();

But I still can't access any controller and get 503 Service Unavailable in the developer console after attempting to submit the form.

Please describe the steps needed to allow specific controllers in maintenance mode. I try to let users subscribe to my newsletter and send the contact form, but they should not be allowed to shop.

EDIT: This question is obviously not a duplicate of (1.9.0.1 Maintenance Mode) because I don't ask how to put magento in maintenance mode. Learn english please @MagenX.


texts: Why Collection showing only first field value

texts:
I am just new to Magento and trying to get collection from sales/order_item model
i don't know whether i am asking it right way or not but i am having following problem in getting values from db in magento 1.9.0.1

My db table looks like this

--------------------------------------------------------------------------
item_id    order_id    customid   ...... remaining column .....
   1           1           1
   2           2           1
   3           2           2
   4           2           1
   5           3           1
--------------------------------------------------------------------------

what i am trying to do is to  get customid from order_id value which i have.

but it's showing only first value of customid which is 1 if order_id is 2

i am using below code

public function getCustomValue()
    {
        $id = $this->getRequest()->getParam('order_id');
        $collections = Mage::getModel('sales/order_item')->getCollection()
                    ->addFieldToFilter('order_id', $id);
        foreach ($collections as $c) {
            $customid = $c->getCustomid();
        }
        return $customid;
    }

So if i use

echo $this->getCustomValue();

it shows 1 only.

but as in my table order_id got 3 entry with 1,2,1 customid


texts: My administrator page on add you site product or added products view problem. Catalog page blank.


texts: layout.xml in custom module is not working

texts:
My config code

<config>
    <modules>
        <Urban_Module>
            <version>1.0.0</version>
        </Urban_Module>
    </modules>
<global>
        <helpers>
            <Module>
                <class>Urban_Module_Helper</class>
            </Module>
        </helpers>
</global>
<frontend>
        <routers>
            <module>
                <use>standard</use>
                <args>
                    <module>Urban_Module</module>
                    <frontName>module</frontName>
                </args>
            </module>
        </routers>
         <layout>
            <updates>
                <module>
                    <file>module.xml</file>
                </module>
            </updates>
        </layout>
    </frontend>
</config>

My TestifrontController.php code

<?php
class Urban_Module_TestifrontController extends Mage_Core_Controller_Front_Action
{
    public function indexAction()
    {
    $this->loadLayout();

    $this->renderLayout();
   echo 'hello frontend';

    }
}

My module.xml code

<?xml version="1.0"?>
<layout version="0.1.0">
    <default>
    </default>
    <module_testifront_index>
        <reference name="content">
            <block type="module/module" name="module" template="module/module.phtml"/>
        </reference>
    </module_testifront_index>
</layout>

This module.xml path i have used is app/design/frontend/[package]/default/layout/module.xml . I have the module.phtml file in app/design/frontend/[package]/default/template/module/module.phtml.

The controller works when I navigate to index.php/module/testifront/index but the layout doesn't seem to work.


texts: Magento 2 - How to remove an unknown module?

texts: We have installed a module before and we deleted the module source accidentally. Magento cannot start due to missing module. Is there any way to force uninstall a missing module?


texts:
I'm getting the following error after moving a Magento 1.9.1 project from my local Vagrant box to a remote server:

  Fatal error: Call to a member function beginTransaction() on boolean
  in /var/www/html/app/code/core/Mage/Core/Model/Abstract.php on line
  313

This errors points to this section of code:

  $this->_getResource()->beginTransaction();

Where $this->_getResource is returning false. This seems to be caused by either a Model autoloading issue, or models not getting initialized correctly but I cannot find the cause.

The app has no errors locally, and I don't see any major differences between my server environment and local environment. Here are the config files and model files that are relevant to the problem

config.xml

<models>
    <company_xmpieformbuilder>
        <class>Company_XMPieFormBuilder_Model</class>
        <resourceModel>xmpieformbuilder_resource</resourceModel>
    </company_xmpieformbuilder>
    <xmpieformbuilder_resource>
        <class>Company_XMPieFormBuilder_Model_Resource</class>
        <entities>
            <configuration>

company_xmpieformbuilder_configuration

            </configuration>
            <fieldset>

company_xmpieformbuilder_fieldset

            </fieldset>
            <field>

company_xmpieformbuilder_field

            </field>
            <fieldtype>

company_xmpieformbuilder_field_type

            </fieldtype>
            <fieldinputcontrol>

company_xmpieformbuilder_field_input_control

            </fieldinputcontrol>
            <fieldattributes>

company_xmpieformbuilder_field_attributes

            </fieldattributes>
            <fieldpossiblevalues>

company_xmpieformbuilder_field_possible_values

            </fieldpossiblevalues>
            <fieldrule>

company_xmpieformbuilder_field_rule

            </fieldrule>
            <fieldruletype>

company_xmpieformbuilder_field_rule_type

            </fieldruletype>
            <fieldvaluesource>

company_xmpieformbuilder_field_value_source

            </fieldvaluesource>
        </entities>
    </xmpieformbuilder_resource>
    <core>
        <rewrite>
            <abstract_model>Company_Core_Model_Abstract</abstract_model>
        </rewrite>
    </core>
    <catalog>
        <rewrite>
            <product>Company_Catalog_Model_Product</product>
        </rewrite>
    </catalog>
</models>

Example model, all the models are empty similar to this.

class Company_XMPieFormBuilder_Model_Configuration extends Company_Core_Model_Abstract {

    protected function _construct()
    {
        $this->_init('company_xmpieformbuilder/configuration');
    }

}

Base model.

class Company_Core_Model_Abstract extends Mage_Core_Model_Abstract {
}


texts: import images are default to exclude on dataflow

texts:
I am importing images with dataflow, and all looks fine, however after I import they are all pre-selected as excluded:

I am uploading a csv file with sku and image and it should have one more column for setting of exclude however I don't know how to do it.

CSV File:


texts:
Disable shipping in Magento
I need to create a catalog price quotation of products in store
And the store will not deliver the mails, so I need to disable the freight


texts: Solved: Problem add condition showing only show category and attribute sets?

texts:
As you can see my add conditions is only showing category and attribute sets.
Thanks in advance.

Solved. I didnt know was that simple. The show in promotion in all my attributes was off. need more sleep.


texts:
i'm new to Magento and i'd like to copy a complete Magento Storeview (full package incl. the theme) to another server. The Data doesnt matter nor the options just the design.

I already copied the template and skin folders:

/app/design/frontend//...
/skin/frontend//...

But the view isnt as expected. Did i forgot something?


texts: How to add Qty in add to cart form on Product Listings Page for configurable product in Magento 2

texts:
I want to add Qty field on product list page for configurable product and simple product. I am using Magento 2.3.1
can you guide me how can I do?


texts:
On a local server I have a test-instance of Magento 2, by running a new build on that server and then rsyncing the code to the production, I switch to a new without downtime.

Recently I have added a CDN using GCS. I sync my files through gsutil rsync and gsutil cp (cp allows for compression). However, this, combined with caching results in some errors with caching. After I deploy a new instance of my site to production, cache has not been generated and will not be synced to my CDN.

How does caching work with CDN's? Am I required something like Fastly?

The same goes for merged JS files. It seems they are generated on the fly / dynamically. Hence they won't be present on my CDN


texts:
When a customer make an order, in the shipping and billing address appears the extended Province name (for example "Lecce"). Is it possible to show the Region code "LE" instead of the Region name "Lecce"?

Here there is the DB structure:

Country ID > IT
Code (Region code) > LE
Default_name (Region name) > Lecce

I don't want to modify directly this table "directory_country_region" in the DB.


texts:
In the admin backend on the order grids we used to be able to do an exact search like, "Firstname" in Magento 2.2.5

Now i have upgraded Magento to 2.2.8 and the exact match doesn't work anymore. It seems like the fulltext search is broken. How can I fix that?

Thanks in advance!


texts:
I am trying to get products data having qty >=5 and I tried following options in Search Criteria
/rest/default/V1/products?searchCriteria[page_size]=20&searchCriteria[filter_groups][0][filters][0][field]=stock_item[qty]&searchCriteria[filter_groups][0][filters][0][value]=5&searchCriteria[filter_groups][0][filters][0][condition_type]=gteq

/rest/default/V1/products?searchCriteria[page_size]=20&searchCriteria[filter_groups][0][filters][0][field]=qty&searchCriteria[filter_groups][0][filters][0][value]=5&searchCriteria[filter_groups][0][filters][0][condition_type]=gteq

/rest/default/V1/products?searchCriteria[page_size]=20&searchCriteria[filter_groups][0][filters][0][field]=extension_attributes[qty]&searchCriteria[filter_groups][0][filters][0][value]=5&searchCriteria[filter_groups][0][filters][0][condition_type]=gteq

/rest/default/V1/products?searchCriteria[page_size]=20&searchCriteria[filter_groups][0][filters][0][field]=extension_attributes[stock_item[qty]]&searchCriteria[filter_groups][0][filters][0][value]=5&searchCriteria[filter_groups][0][filters][0][condition_type]=gteq

/rest/default/V1/products?searchCriteria[page_size]=20&searchCriteria[filter_groups][0][filters][0][field]=extension_attributes[stock_item][qty]&searchCriteria[filter_groups][0][filters][0][value]=5&searchCriteria[filter_groups][0][filters][0][condition_type]=gteq

but none of them is working for me, I have magento version 2.3.3 , having MSI but only 1 source.
and all are giving error as:

The "%1" attribute name is invalid. Reset the name and try again.


texts:
In Magento 2, there is a box to place custom CSS to any block.

However, I don't see that as an option in Magento 1

How do I add custom CSS to a block in Magento 1?

Edit for possible dupe:
I want to know how to just add some css to a block, is there not a way to just do that in Magento 1? Do I have to create a custom css and layout class for every block? If that is the case, can I have someone explain a little more clearly how to do this?

Edit for comments:
It won't save an in file style block


texts: Checkout session clears after first step on Onepage

texts:
I have the same problem as here:
Cart dropping all items / cart session clears

Although the answer seems to work for the questioner, for me it doesn't. I have really tried "everything" now:

Set session.gc_maxlifetime to 12 hours
Changed Magento session storage from db to files
Set all Magento cookie validation settings to "No"
Cleaned all caches, and cache storage (memcached)
Validated that the session lifetime in cookie is using the gc_maxlifetime setting

In detail, the session gets cleared after some seconds of inactivity. If I do a fast "developer checkout" within a few seconds, I have no problems to checkout. But as you surely know not all customers are fast in typing and so on.
The furthermore strange thing is, that after this happened once, it is working again for the next one or two times.

I would really appreciate any kind of idea to this.


texts: Magento 2 : How to use filter call back in magento 2 admin grid

texts:
How to use filter condition call back in Magento 2 in PHP Grid as we where using in Magento 1 previously like :

'filter_condition_callback' => array($this, '_customFilterCallBack')


texts:
I am using magento 2 EE and I am facing wishlist side bar not showing for some customers like:

I have two customers

one customer pawan@gmail.com- customer type - Individual user

second customer kumar@gmail.com - customer type - Company admin

for Individual user wishlist sidebar is showing but for Company admin  wish list side bar not showing is there any restriction available if any one knows please explain i have checked code.

I am not able to find anything!


texts:
I need to add some code to cart.phtml to get the product ID's of the item in the cart.  I need the ID's of the simple products.  So far I have this:

  <?php $quote = Mage::getSingleton('checkout/cart')->getQuote();
$productIds = "";
foreach($quote->getAllItems() as $item):
    if(!$item->getParentItemId()) continue; // Don't output config Id's
    if (strlen($productIds)==0){
        $productIds = "'".$item->getProductId()."'";
    }
    else{
        $productIds = $productIds.",'".$item->getProductId()."'";
    }
endforeach;?>

This currently shows the ID's of Simple Products that are part of a configurable product.  The problem is if the product is a simple product that isn't part of a configurable product it's ID doesn't get shown.

Any ideas how to get these to show also?


texts: SyntaxError: Cannot read property 'numerator' of undefined in pub\static\fron \package\theme\en_US\css\source\lib\_responsive.less

texts:
SyntaxError: Cannot read property 'numerator' of undefined in

pub\static\frontend\package\theme\en_US\css\source\lib_responsive.less

on line 44, column 9:

43     @media only screen and (max-width: (@screen__m - 1)) {
44         .media-width('max', @screen__m);
45     }


texts: Magento 2 Custom Option File Upload gets 404 when trying to download from order view

texts:
We have a custom option on a product to upload an image with the product (business cards).
The order is placed just fine and the link to download the image is on the order in the backend.
When I click on the link to download the image it takes me to a 404 page.
Here are the items I have checked to try to track down this issue:

Check permissions to media folder and it is owned by web user and has
777 permissions for all sub-folders and files
Placed a test order using the zero subtotal checkout payment method and everything worked fine
Placed a test order using the paypal express checkout payment method and get the 404 error message on the file again.
I checked the database table quote_item_option for the option_id list in the URL and it doesn't exist for the paypal express payment
method orders.
I checked the /pub/media/custom_options/quote folder and the files exist under the first two letters of the file name and I am able
figure out which image goes with which order based on the dimension of
the image. These files exist for all orders no matter the payment
method.

Does anyone have any idea what could be causing this? I am at a lost.

Here is the URL for a test paypal express payment
https://pc.drivemarketing.com/sales/download/downloadCustomOption/id/86165/key/01a76f8e26cb34a30854/


texts: Discount on shipping rate coming from ups

texts: I want to give 15% discount on shipping rate that I get from ups in magento.any idea ?


texts:
Can anyone point out how someone would achieve a surcharge (percentage) on orders over a certain threshold in Magento.

In Drupal I would use rules to trigger a tax % added to the subtotal of the order and only if the order is over a threshold (condition).

Are there any such core modules in Magento ?

Any help would be much appreciated.


texts: I am moving Magento 2.2.7 to new version 2.3.2. Theme migration has just finished, but some urls not working. e.g In original site https://www.magento.com/media indicated to pub/media, but in my local, it doesn't indicate and shows 404 error. And base url is "http://127.0.0.1/magento", but some links redirect to http://127.0.0.1/suburl, not http://127.0.0.1/magento/suburl. Who can solve this problem?


texts: Product view is blank on certain products

texts:
The product view page is blank on some products within my Magento store. I have the following error in the log:

[05-Oct-2015 21:18:34 UTC] PHP Fatal error: `Call to a member function productAttribute() on a non-object in /home/mysite/public_html/app/design/frontend/mytheme/default/template/catalog/product/view.phtml on line 69`

The piece of code to which this refers is as follows:

<?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?>

Can anyone please assist with this issue?

All products on the site are imported via database. As far as I can see the only difference with the products that appear blank is that there's no 'short description' content. I've added content to the short description as a test but that didn't seem to fix the issue. Short description is identified as a required field.


texts: Magento 2.2 integration callback URL is not receiving OAuth data

texts:
I'm trying to implement OAuth 1.0a in Magento 2.2. As per Magento docs, I created an integration, providing a Ngrok URL that points to localhost:8080 of my computer as the callback URL. However, when I'm activating the integration, my callback URL endpoint receives no data, but I'm also not getting any errors when activating the integration.
I want to get the OAuth data that Magento claims to send to the callback URL to continue OAuth authentication, but I'm now stuck at this point as Magento doesn't send it.
How can I overcome this issue? Any helpful suggestions are highly appreciated.


texts: Magento 1.6 - Paypal Standard is not taking to paypal Payment page

texts:
My Magento 1.6 settings with paypal is not working at all. I am trying to setup Website Payments Standard however its not working. Its taking me to https://www.sandbox.paypal.com/home instead of the Payment page (similar is the issue without sandbox, i.e. with live).

here is what is already done:

I have setup the developer's account at the new https://developer.paypal.com
created sellers and buyers test accounts there
setup seller's needed basic info at https://www.sandbox.paypal.com/ (such as Page Style and IPN)..
enabled mage_paypal at magento admin
enabled 'Website Payments Standard' at Paypal section at magento admin and setup all the relevant settings as needed.

Now, I can see the paypal payment option at the checkout page (onepage), but when I click on "Place order" at Order Review section, it takes me to the black page and says that its redirecting me to paypal... then it takes me to https://www.sandbox.paypal.com/home instead of payment page.

I think this is due to new changes in Paypal system and also due to the magento system because we have used paypal standard so many times on regular custom websites but never seen this....

[UPDATES]
Here is the form on the redirect page:

<form action="https://www.sandbox.paypal.com/webscr" id="paypal_standard_checkout"
name="paypal_standard_checkout" method="POST">
<input name="form_key" type="hidden" value="**********" />
</form>

As you can see, it not the regular form of paypal we are used to.... So either its an issue with magento, or maybe its suppose to be like this....

Can anyone tell me what to do?


texts: app:config:dump locks everything in configuration

texts:
I am using pipeline deployment. As suggested in Magento 2.2 documentation, to use pipeline deployment process  use below code:

  app:config:dump

and add config.php to source control. But when i execute app:config:dump it locks everything in system configuration.
Even not able to update store email addresses.

Is there any way to dump only required settings that will be used to generate static content on build system?

I am confused whether to use pipeline deployment or not.
I am using Magento 2.2 CE Open Source version.

Any one has implemented pipeline deployment and any suggestion for me.

Thanks in advance.


texts: Strange discrepancy with tiered pricing percentages

texts:
Bit stumped by this so reaching out here. Got asked a question by a client - they had a product retailing at 11.40. They added tiered pricing, so if you bought 10 you got 5% off, so the price was then 10.83. But, Magento is displaying a notice that the discount is 6%:

I've experimented with different prices (adding a tiered price of the original minus 5% each time), and it seems that between 11.27 and 11.41 the discount is shown as 6%, but anything either side of that correctly shows it as 5%:

Anyone any ideas on why that is? Is it a bug?

Also, just to note, if you move the decimal points 2 places, so the price is 1140 and the tiered price is 1083, it shows as 5%:


texts: I am using Soap v2 api of magento 1.9.2. I am trying to get catalogCategoryTree response in xml but I am getting another format every time. I tried to add header below the starting line of php script, but after adding header I did not receive any response. Help me to resolve this issue.


texts: SID in url shows as SID= and doesn't pass the id with FPC

texts:
I have a webstore that links to 5 other webstores and passes the sid param so that we can share cart and what not. The site and this functionality has worked fine for the last 2 years. The website is setup using Enterprise 1.11 and utilizes default FPC

However, we just recently started noticing that when linking to one of the webstores that is mainly a landing page, which links to the other stores, the SID is sometimes blank.

We started noticing when trying to have affiliate links going to that site and then transferring the affiliate source to the other stores through the session.

after thinking about it and wondering how the SID's were changing with FPC on anyways without any page hole, I found that it is handled in this class

Enterprise_PageCache_Helper_Url

I am only able to reproduce it by going to the site, making sure the page is cached, deleted the frontend cookie through web dev tools, refreshing the page and noticing that it isn't generating a new frontend cookie, thus maybe there is no new session id that can be pulled into to fill in the correct SID on the links.

I would believe that if a page was cached and a user gets there without ever having a frontend cookie it should have that set in FPC processing process. I am thinking this is a bug but maybe I am wrong.

I am wondering if anyone can provide any insight into this. I tested the same thing on a 1.13 instance. If you go to a page, make sure it is cached delete your frontend cookie, refresh the page you will see no new frontend cookie.


texts: | Can't Access Web Setup Wizard | Welcome to Magento Admin

texts:
I am facing the above issue in my **live** store. Please let me know.

There is not a display proper page. I need to install some Extension via admin panel but I am not seeing that page proper as attached image.


texts: Overwriting community controller from local

texts:
Let's say I wan't to override a community module named Aaa_Aaa with local module named Zzz_Zzz. It seems that no matter what I do, my local module loads after the community one, so the community module is matched first. I tried this:

<frontend>
    <routers>
        <aaa_aaa>
            <args>
                <modules>
                    <zzz_zzz before="Aaa_aa">Zzz_Zzz</zzz_zzz>
                </modules>
            </args>
        </aaa_aaa>
    </routers>
</frontend>

app/code/local/Zzz/Zzz/controllers/IndexController.php

<?php

require_once Mage::getModuleDir('controllers','Aaa_Aaa') . DS . 'IndexController.php';

class Zzz_Zzz_IndexController extends Aaa_Aaa_IndexController
{
    public function indexAction()
    {
        //doesn't get to this
    }
}

app/etc/modules/Zzz_Zzz.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Zzz_Zzz>
            <active>true</active>
            <codePool>local</codePool>
        </Zzz_Zzz>
        <Aaa_Aaa>
            <active>true</active>
            <codePool>community</codePool>
            <depends>
                <Zzz_Zzz />
            </depends>
        </Aaa_Aaa>
    </modules>
</config>


texts:
I have a magento site with a huge database (~9G) with empty log tables on MySQL and the site is getting a little bit slower with the databases getting larger. Is magento designed to support a databases this large with ~200K products ? If not what are the alternatives besides deleting products ?

I know this is a vague question  but i just want some informed opinions.

Thank you in advance.


texts: Magento 2.4: Magento\Framework\Exception\LocalizedException: The XML in file Element 'event': Missing child element(s). Expected is ( observer )

texts:
i am getting  below error in magento 2.4 and it is working fine in magento 2.3.
how can i resolve this one?
Magento\Framework\Exception\LocalizedException: The XML in file "/var/www/html/magento240/app/code/PPPL/PhonePe/etc/frontend/events.xml" is invalid: Element 'event': Missing child element(s). Expected is ( observer ). Line: 4 Verify the XML and try again. in /var/www/html/magento240/vendor/magento/framework/Config/Reader/Filesystem.php:156 Stack trace: #0
Please find the below code
enter code here<?xml version="1.0"?><config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"><event name="checkout_onepage_controller_success_action">
    <!-- Do nothing -->
</event></config>


texts:
I have a problem with my shipping estimate, I can't trace the problem...

The thing is that when I choose any country from the list and click on Estimate and Update nothing happens...

Table rates are set.
Shipping methods are contry based, so if you choose any other country than Spain, only internation shipping should appear.

There are no errors, nothing, where should I search for indicators of the problem?

I've found this line in cartController.php:

    /**
 * Estimate update action
 *
 * @return null
 */
public function estimateUpdatePostAction()
{
    $code = (string) $this->getRequest()->getParam('estimate_method');
    if (!empty($code)) {
        $this->_getQuote()->getShippingAddress()->setShippingMethod($code)/*->collectTotals()*/->save();
    }
    $this->_goBack();
}

I don't know if the /* has to do anything with it... I didn't change anything there, so I assume it's by default like that?

If someone interested in seeing it in action, here's the link: Store Link

Thanks guys,


texts: What is the preferred base class for Payment method

texts:
I will write a payment module and read some tutorials. All tutorials are using \Magento\Payment\Model\Method\Cc or \Magento\Payment\Model\Method\AbstractMethod to extend from, but both are deprecated.

What ist the preferred class to write a payment method?


texts:
Where should I look (xml file) when :
Search result are bugged in only my theme. ( I have to press 2 times on the arrow "relevance" to get true result).
If I use "Magento Luma", everything is fine.

I tried to search for catalog_search..xml, nothing found.

Magento 2


texts: What is the best method to retrieve a SINGLE ITEM order details in Magento2?

texts:
I am currently using the

\Magento\Sales\Model\OrderFactory $_orderFactory

and

loadByIncrementId($id)

in my custom block and calling it in my .phtml file.

I get basic details of the order, but I have only single item in the order, still I have to use the $bookingDetail->getAllItems() in foreach loop.
Is it really necessary? Can't we get a single item detail without the foreach loop?
Also about single Product option: getproductOptions() loop for single option/value?

What is the best practice?


texts: I am working on a magneto 2 site and everywhere I go there is written run this command and run that command but no explain how can I open that command line or composer. please explain


texts: How to remove index.php from front end URL In magento?

texts:
I am working on magento-1.9.

How to remove index.php from my website's front end url?

Any one know so please tell me


texts: How Can i Restrict My Search from based on Details (Description)

texts: I need to restrict name search based on details (details). I want name search applicable only on products name, how can i restrict name search based on details(description)


texts:
I am needing to resize (reduce) the zoomed product page image. After clicking on the image and the popup image opens, it fills the whole page. I need to reduce the size to where it is not so large, maybe 1/2 to 2/3 the screen size. My actual images are sized 1500 x 1500. Some are saved at 1000 x 1000.
I am using the Porto Theme on Magento 2.3.5-p2. I reached out to Porto (smartwave) support and was told this was out of their scope. Hopefully someone can point me in the right direction